缓存的工作原理

 更新时间:2016年11月25日 15:57  点击:1328

缓存的工作原理其实并不复杂。它的核心思想是:首先,我们将需要显示的内容存储在一个文本文件(即缓存文件)之中。然后,如果有用户请求某个页面的内容,我们首先检查此页对应的缓存(即那个文本文件)是否存在——如果存在且为最新的缓存文件,那么直接将这个文本文件中的内容输出到客户端供用户查看;如果此页对应的缓存文件不存在或缓存生成的时间不符合要求(太旧),那么直接执行一次此页对应的PHP文件,并将显示内容存储在缓存文件中。重复上述流程。这样一来,虽然增加了PHP代码,但我们最大程度的节省了PHP链接到数据库教程再提取数据的时间。

*/

   //导入缓存类
   require_once('cache.class.php教程');
   //创建一个缓存类对象CacheManager
   $CacheManager = new Cache();
   //调用startCache方法,表示开始缓存
   $CacheManager->startCache();
   //以下区块所有echo内容都将作为缓存写入缓存文件中
   echo "Start Cache example at: ".date('H:i:s')."<br/>";
   sleep(2);
   echo "End Cache example at: ".date('H:i:s')."<br/>";
  
   echo "<br/><a href='clear.php'>Clean the cache</a><br/>";
   //以上区块所有echo内容都将作为缓存写入缓存文件中
   $CacheManager->endCache();


//cache.class.php代码

class Cache {
   var $status    = true;     // 值为True表示开启缓存;值False表示关闭缓存功能。
   var $cacheDir  = 'cache/'; //存放缓存文件的默认目录
   var $cacheFile = '';       //缓存文件的真实文件名
   var $timeOut   = 1000;     // 内容被重复使用的最长时限
   var $startTime = 0;        // 程序执行的开始时间
   var $caching     = true;     // 是否需要对内容进行缓存;值为False表示直接读取缓存文件内容
  
   function getMicroTime() {
           list($usec, $sec) = explode(" ",microtime());
          return ((float)$usec + (float)$sec);
    }

function startCache(){
      $this->startTime = $this->getMicroTime();
      ob_start();
      if ($this->status){
         $this->cacheFile = $this->cacheDir.urlencode( $_SERVER['REQUEST_URI'] );
         if ( (file_exists($this->cacheFile)) &&
              ((fileatime($this->cacheFile) + $this->timeOut) > time()) )
         {
            //从缓存文件中读取内容
            $handle = fopen($this->cacheFile , "r");
            $html   = fread($handle,filesize($this->cacheFile));
            fclose($handle);
         
            // 显示内容
            echo $html;

            // 显示程序执行时间          
           echo '<p>Total time: '
                 .round(($this->getMicroTime())-($this->startTime),4).'</p>';
           
            //退出程序
            exit();
          }
          else
          {
             //置缓存标志caching为true
             $this->caching = true;
          }
      }
    }

function endCache(){
      if ($this->status){
         if ( $this->caching )
         {
            //首先输出页面内容,然后将输出内容保存在缓存文件中
            $html = ob_get_clean();
            echo $html;
            $handle = fopen($this->cacheFile, 'w' );
            fwrite ($handle, $html );
            fclose ($handle);

            //显示页面执行时间           
            echo '<p>Total time: '.round(($this->getMicroTime()-$this->startTime),4).'</p>';
         }
      }      
    }

function cleanCache(){
       if ($handle = opendir($this->cacheDir)) {
          while (false !== ($file = readdir($handle))) {
             if (is_file($this->cacheDir.$file)) unlink($this->cacheDir.$file);
          }

          closedir($handle);      
       }
    }

}


// 再一个简单的php  缓存文件实例代码


if ($content = $cache->start($cache_id))
{
 echo $content;
 exit();
}

require_once 'Cache/Function.php';
 

 $cacheDir = './pear_cache/';
 $cache = new Cache_Function('file',array('cache_dir' => $cacheDir));
 $arr = array('东方', '南方','西方');
 $cache->call('slowFunction', $arr);
 echo '<BR>';

 $arr = array('东方', '南方','西方');

 slowFunction($arr);

  function slowFunction($arr = null)
 {
  echo "一个执行起来很慢的函数 :( <br>";
  echo "当前时间是 " . date('M-d-Y H:i:s A', time()) . '<br>';
  foreach ($arr as $fruit)
  {
   echo "太阳此时正在 $fruit <br>";
  }
 )

if( $_POST )
{

 $str = '23=12,34  78=1,3 45=12,46,78,89=33'; 

 $content=nl2br($str); 

 $content=str_replace(" ","",$content); 

 $arr=explode("<br/>",$content); 

 $result=array(); 

 foreach ($arr as $value) 

 { 

$k=explode("=",$value); 

 $result[]=array($k[0]=>$k[1]); 

 } 

 //数组转换成字串 

 function arrayeval($array, $level = 0) { 

  $space = ''; 

  for($i = 0; $i <= $level; $i++) { 

  $space .= " "; 

  } 

 $evaluate = "Array $space( "; 

  $comma = $space; 

  foreach($array as $key => $val) { 

   $key = is_string($key) ? '''.addcslashes($key, ''\').''' : $key; 

   $val = !is_array($val) && (!preg_match("/^-?d+$/", $val) || strlen($val) > 12 || substr($val, 0, 1)=='0') ? '''.addcslashes($val, ''\').''' : $val; 

   if(is_array($val)) { 

    $evaluate .= "$comma$key => ".arrayeval($val, $level + 1); 

  } else { 

    $evaluate .= "$comma$key => $val"; 

   } 

   $comma = ", $space"; 

  } 

 $evaluate .= " $space)"; 

  return $evaluate; 

 } 

//把结果写到文件 

 $config=arrayeval($result); 

 $strwrite="<?php ".'$'.'shuzu'.'='.$config." ?>"; 

 $fp=fopen('config.php','w'); 

 fwrite($fp,$strwrite); 

 fclose($fp); 
 }

 ?>

<form action="b.php?action=5" method="get"> 

<textarea name="content"></textarea> 

<input type="submit" value="submit" /> 

</form>

述前说明:
CREATE VIEW 语句时,ANSI_NULLS 和 QUOTED_IDENTIFIER 选项必须设置为 ON。OBJECTPROPERTY 函数通过 ExecIsAnsiNullsOn 或 ExecIsQuotedIdentOn 属性为视图报告此信息

表a,字段a1,a2
表b,字段b1,b2
要弄个视图union all两个表

$sql ='CREATE VIEW dbo.VIEW2
  AS
  SELECT * FROM a
  UNION ALL
  (SELECT * FROM b )';
  

上面的是简单的创建视图并没有索引下面我们来看看关于创建索引视图

对指定表或指定表的视图创建关系索引。可在向表中填入数据前创建索引。可通过指定限定的数据库教程名称对另一个数据库中的表或视图创建关系索引。
语法:

CREATE [ UNIQUE ] [ CLUSTERED | NONCLUSTERED ] INDEX index_name
    ON <object> ( column_name [ ASC | DESC ] [ ,...n ] )
    [ WITH <backward_compatible_index_option> [ ,...n ] ]
    [ ON { filegroup_name | "default" } ]

<object> ::=
{
    [ database_name. [ owner_name ] . | owner_name. ]
        table_or_view_name
}

<backward_compatible_index_option> ::=
{
    PAD_INDEX
  | FILLFACTOR = fillfactor
  | SORT_IN_TEMPDB
  | IGNORE_DUP_KEY
  | STATISTICS_NORECOMPUTE
  | DROP_EXISTING
}


//--创建视图  
  create   view   v  
  with   schemabinding  
  as  
  select   ID,name   from   dbo.A  
  go  
   
//  --创建索引  
  create   unique   clustered   index   v_index   on   v(ID)

php教程 发送邮箱实例代码


class pop3 {


        public $server="pop3.126.com";//服务器名
        public $server_port=110;//服务器端口
        public $timeout=30;//超过多少时间就算连接失败
        public $connection=0;//保持与主机的连接
        public $state="DISCONNECTED";//保存当前的状态  
        public $debug=0;//是否显示错误信息
        public $err_str="";//服务器返回的错误信息
        public $err_no;//服务器返回的错误号
        public $respones;//保存服务器返回的信息
        public $apop;//说明需要使用加密方式进行密码验证
        public $messages;//邮件数
        public $size;//邮件的总大小
        public $mail_list;//保存各个邮件的大小及在服务器上的序列号
        public $head=array();//邮件头的内容数组
        public $body=array();//邮件体的内容数组 


        function POP3($server,$server_port,$timeout)
        {
                $this->server=$server;
                $this->server_port=$server_port;
                $this->timeout=$timeout;
                $this->debug=TRUE;
        }

        function open()
        {
                if($this->server=="")
                {
                        $this->err_str="无效的主机名!";
                        return FALSE;
                }
                if($this->debug)  echo "正在打开  $this->server,$this->server_port,$this->timeout";
                if(!$this->connection=@fsockopen($this->server,$this->server_port,$err_no,$err_str,$this->timeout))
                {
                        $this->err_str="连接到POP服务器失败,错误信息:".$err_str."错误号:".$err_no;
                        return FALSE;
                }
                else
                {
                        $this->getresponse();
                        if($this->debug)
                            $this->outdebug($this->response);
                        if(substr($this->respones,0,3)!="+OK")
                        {
                                $this->err_str="服务器返回无效信息:".$this->respones."请检查pop服务器是否正确";
                                return FALSE;
                        }
                        $this->state="AUTHORIZATION";
                        return TRUE;
                }
        }

        function getresponse()
        {
                for($this->respones;;)
                {
                        if(feof($this->connection))
                            return FALSE;
                        $this->respones.=fgets($this->connection,100);
                        $length=strlen($this->respones);
                        if($length>=2&&substr($this->respones,$length-2,2)=="rn")
                        {
                                $this->respones=strtok($this->respones,"rn");
                                return TRUE;
                        }
                }
        }

        function outdebug($message)
        {
                echo htmlspecialchars($message)."n";
        }

        function command($command,$length,$code)
        {
                if($this->connection==0)
                {
                        $this->outdebug("没有连接到任何服务器,请检查网络连接!");
                        return FALSE;
                }
                if($this->debug)
                    $this->outdebug(">>> $command");
                if(!fput($this->connection,"$command rn"))
                {
                        $this->outdebug("'无法发送命令'.$command");
                        return FALSE;
                }
                else
                {
                        $this->getresponse();
                        if($this->debug)
                           $this->outdebug($this->respones);
                        if(substr($this->respones,0,$length)!=$code)
                        {
                                $this->outdebug("$command.'命令服务器返回信息无效'.$this->response");
                                return FALSE;
                        }
                        else
                            return TRUE;
                }
        }

        function login($user,$pass)
        {
                if($this->state!="AUTHORIZATION")
                {
                        $this->outdebug("没有连接到任何服务器或状态不对!");
                        return FALSE;
                }
                if(!$this->apop)
                {
                        if(!$this->command("USER $user",3,"+OK"))  return FALSE;
                        if(!$this->command("PASS $pass",3,"+OK"))  return FALSE;
                }
                else
                {
                        if(!$this->command(" APOP $user".md5($this->greeting.$pass),3,"+OK"))  return FALSE;
                }
                $this->state="TRANSACTION";
                return TRUE;
        }

        function stat_sum()
        {
                if($this->state!="TRANSACTION")
                {
                        $this->outdebug("还没有连接服务器或没有成功登陆");
                        return FALSE;
                }
                if(!$this->command("STAT",3,"+OK"))
                    return FALSE;
                else
                {
                        $this->respones=strtok($this->respones," ");
                        $this->messages=strtok(" ");
                        $this->size=strtok(" ");
                        return TRUE;
                }
        }

        function listmail($mess=null,$uni_id=null)
        {
                if($this->state!="TRANSACTION")
                {
                        $this->outdebug("还没有连接服务器或没有成功登陆");
                        return FALSE;
                }
                if($uni_id)
                   $command="UIDL";
                else
                   $command="LIST";
                if($mess)
                   $command.=$mess;
                if(!$this->command($command,3,"+OK"))
                   return FALSE;
                else
                {
                        $i=0;
                        $this->mail_list=array();
                        $this->getresponse();
                        while($this->respones!=".")
                        {
                                $i++;
                                if($this->debug)
                                   $this->outdebug($this->respones);
                                if(uni_id)
                                {
                                        $this->mail_list[$i][num]=strtok($this->respones," ");
                                        $this->mail_list[$i][size]=strtok(" ");
                                }
                                else
                                {
                                        $this->mail_list[$i][num]=intval(strtok($this->respones," "));
                                        $this->mail_list[$i][size]=intval(strtok(" "));
                                }
                                $this->getresponse();
                        }
                        return TRUE;
                }
        }

        function getmail($num,$line=-1)
        {
                if($this->state!="TRANSACTION")
                {
                        $this->outdebug("还没有连接服务器或没有成功登陆");
                        return FALSE;
                }
                if($line<0)
                   $command="RETR $num";
                else
                   $command="TOP $num $line";
                if(!$this->command($command,3,"+OK"))
                   return FALSE;
                else
                {
                        $this->getresponse();
                        $is_head=TRUE;
                        while($this->respones!=".")
                        {
                                if($this->debug)
                                   $this->outdebug($this->respones);
                                if(substr($this->respones,0,1)!=".")
                                {
                                        $this->respones=substr($this->respones,1,strlen($this->respones)-1);
                                }
                                if(trim($this->respones)=="")
                                    $is_head=FALSE;
                                if($is_head)
                                   $this->head[]=$this->respones;
                                else
                                   $this->body[]=$this->respones;
                                $this->getresponse();
                        }
                        return TRUE;
                }
        }

        function dele($num)
        {
                if($this->state!="TRANSACTION")
                {
                        $this->outdebug(",不能删除远程信件,还没有连接服务器或没有成功登陆");
                        return FALSE;
                }
                if(!num)
                {
                        $this->outdebug("删除的邮件参数不对");
                        return FALSE;
                }
                if($this->command("DELE $num",3,"+OK")) return TRUE;
                else return FALSE;
        }

        function close()
        {
                if($this->connection!=0)
                {
                        if($this->state=="TRANSACTION")
                           $this->command("QUIT",3,"+OK");
                        fclose($this->connection);
                        $this->connection==0;
                        $this->state="DISCONNECTED";
                }
        }
}

//发送邮件类调用方法

$host="pop3.126.com";
    $user="    ";
    $pass="     ";
    $rec=new pop3($host,110,20);
    if(!$rec->open()) die($rec->err_str);
       echo "open";
    if(!$rec->login($user,$pass)) die($rec->err_str);
       echo "login";
    if(!$rec->stat()) die($rec->err_str);
       echo "共有".$rec->messages."封信件,共".$rec->size."字节大小";
    if($rec->messages>0)
    {
            if(!$rec->listmail()) die($rec->err_str);
               echo "有以下信件:";
            for($i=1;$i<=count($rec->mail_list);$i++)
            {
                    echo "信件".$rec->mail_list[$i][num]."大小".$rec->mail[$i][size]."";
            }
            $rec->getmail(1);
            echo "邮件头的内容:";
            for($i=0;$ihead;$i++)
               echo htmlspecialchars($rec->head[$i])."n";
            for($i=0;$ibody;$i++)
               echo htmlspecialchars($rec->body[$i])."n";
    }
    $rec->close();

类只能php教程 5.30以上的版本才能使用,继承了上一个版本的快速重定向的特点(单独类,全部使用静态调用),增添了一个很重要的功能和属性 可以调用其他url中的模块了 也使得模块与模块间或页面与页面间的函数简化共享得以实现

.htaccess文件写法:
复制代码 代码如下:
#-------------- .htaccess start ---------------

RewriteEngine on
RewriteRule !.(js|ico|gif|jpg|png|css教程|swf|htm|txt)$ index.php
php_flag magic_quotes_gpc off
php_flag register_globals off

#-------------- .htaccess end ---------------

 

重写功能引入:让站点根目录的index.php末尾写上下列代码,重写就开启了(正常条件:1.apache的重写配置成功,且开启了.htaccess支持的.2.站点根目录的.htaccess文件设置好了.3.class.rewrite.php类文件在index.php前面部分加载了.4.页面模块文件位置及写法无误):
复制代码 代码如下:
//............

Rewrite::__config(
$config['path'],/*'http://xxxxx/mysite/'URL基础位置*/
$config['md_path'],/*'c:/phps教程ite/www/mysite/modules/'模块文件物理目录*/
array(
'phpinfo'
)
);
Rewrite::__parse();

//..........

模块文件写法:

testPk.php
复制代码 代码如下:
<?php
class Rw_testPk extends Rewrite {

//这个是前导函数,只要访问到testpk这个页面,这个必然会执行,可用来控制本页面内函数访问权限或本页面全局变量
public static function init(){
//if (!defined('SITE_PASS')){
echo self::$linktag.'<br/>';//self::$linktag是页面解析位置路径值,会常使用.
//}
}

//当访问"http://localhost/testpk/"时会执行
public static function index(){
echo 'test';
}

//当访问"http://localhost/testpk/blank"时会执行或写作"http://localhost/testpk/index/blank"一般"index/"都是可以被省略的
public static function blank(){}
}
?>

class.rewrite.php;
复制代码 代码如下:
<?php

class Rewrite{

public static $debug = false;//是否打开调试
public static $time_pass = 0;//获得模块文件整体执行时间
public static $version = 2.2;
public static $pretag = 'Rw_';//模块文件类的名称前缀

public static $linktag = 'index';//页面链接标记,用来标记解析的是那个链接,可用来控制各种菜单效果和链接访问权限

protected static $time_start = 0;
protected static $time_end = 0;
protected static $physical_path = '';//模块文件的物理路径
protected static $website_path = '';//模块文件的站点路径,因为可能把站点放大站点的子目录下,如:http://localhost/site/mysite
protected static $ob_contents = '';
protected static $uid = 0;//配合个人主页访问方式 如http://localhost/423/则是访问http://localhost/profile?uid=423

//允许的系统函数如$allow_sys_fun=array('phpinfo')那么系统将允许链接访问phpinfo内容了,当http://localhost/phpinfo或http://localhost/......./phpinfo时就会直接执行phpinfo这个函数,不需要phpinfo.php模块文件
private static $allow_sys_fun = array();

private static function __get_microtime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}


//设置调试Rewrite::__debug(true);
public static function __debug($d = true){
static::$debug = $d;
}

//配置路径和允许函数
public static function __config($website_path = '',$physical_path = '',$allow_sys_fun = array()){
self::$physical_path = $physical_path;
self::$website_path = $website_path;
self::$allow_sys_fun = $allow_sys_fun;
}

//调试函数
public static function __msg($str){
if(static::$debug){
echo "n<pre>n".print_r($str,true)."n</pre>n";
}
}

//解析开始时间
public static function __start(){
self::$time_start = self::__get_microtime();
}

//解析结束时间
public static function __end($re = false){
self::$time_end = self::__get_microtime();
self::$time_pass = round((self::$time_end - self::$time_start),6) * 1000;
if($re){
return self::$time_pass;
}else{
self::__msg('PASS_TIME: '.self::$time_pass.' ms');
}
}

//内部跨模块url解析调用,如在test1.php模块页面中执行了Rwrite::__parseurl('/test2/show')这句,将调用test2.php模块页面中的show方法(Rw_test2这个class的方法)
public static function __parseurl($url = '',$fun = '',$data = NULL){
if(!empty($url)&&!empty($fun)){
$p = static::$physical_path;
if(file_exists($p.$url) || file_exists($p.$url.'.php') ){
$part = strtolower(basename( $p.$url , '.php' ));
static::$linktag = $part.'/'.$fun;
$fname = static::$pretag.$part;
if(class_exists($fname, false)){
if(method_exists($fname,$fun)){
return $fname::$fun($data);
}
}else{
include( $p.$url );
if( class_exists($fname, false) && method_exists($fname,$fun)){
return $fname::$fun($data);
}
}
}
}
}

//核心链接解析函数Rwrite::__parse();在顶级重写核心定向目标index.php中的执行,意味着Rwrite自定义重写开启
public static function __parse($Url = ''){
self::__start();
$p = static::$physical_path;
$w = static::$website_path;
$req_execute = false;

$url_p = empty($Url) ? $_SERVER['REQUEST_URI'] : $Url;
$local = parse_url($w);
$req = parse_url($url_p);
$req_path = preg_replace('|[^w/.\]|','',$req['path']);
$req_para = empty($Url) ? strstr($_SERVER['SERVER_NAME'],'.',true) : 'www';
if(empty($Url) && substr_count($_SERVER['SERVER_NAME'],'.') == 2 && $req_para != 'www'){
self::__goto($req_para,preg_replace('|^'.$local['path'].'|',"",$req_path));
return ;
}else{
$req_path_arr = empty($req_path)?array():preg_split("|[/\]+|",preg_replace('|^'.$local['path'].'|',"",$req_path));
$req_fun = array_pop($req_path_arr);
if(substr($req_fun,0,2)=='__'){
$req_fun = substr($req_fun,2);
}
$req_path_rearr = array_filter($req_path_arr);

self::__msg($req_path_rearr);

$req_temp = implode('/',$req_path_rearr);
$fname = $req_temp.'/'.$req_fun;
if(!empty($req_fun)&&in_array($req_fun,static::$allow_sys_fun)){
$req_fun();
}else{
if(!empty($req_fun)&&file_exists($p.$fname.'.php') ){
include( $p.$fname.'.php' );
}else{
$fname = empty($req_temp) ? 'index' : $req_temp;
if(file_exists($p.$fname.'.php') ){
include( $p.$fname.'.php' );
}else{
$fname = $req_temp.'/index';
if(file_exists($p.$fname.'.php')){
include( $p.$fname.'.php' );
}else{

//这个地方是对"个人主页"的这种特殊链接定向到"profile/"了,可自己修改
//如:www.xxx.com/12/将表示www.xxx.com/profile/?uid=12或www.xxx.com/profile?uid=12


$uid = is_numeric($req_temp) ? $req_temp : strstr($req_temp, '/', true);
$ufun = is_numeric($req_temp) ? 'index' : strstr($req_temp, '/');
if(is_numeric($uid)){
self::$uid = $uid;
if(!isset($_GET['uid'])) $_GET['uid'] = $uid;
$fname = 'profile/'.$ufun;
if(file_exists($p.$fname.'.php')){
include( $p.$fname.'.php' );
}else{
header("location:".$w);
exit();
}
}else if(file_exists($p.'index.php')){
$fname = 'index';
include( $p.'index.php' );
}else{
header("location:".$w);
exit();
}
}
}
}
$ev_fname = strrpos($fname,'/')===false ? $fname : substr($fname,strrpos($fname,'/')+1);
$ev_fname = static::$pretag.$ev_fname;
if( class_exists($ev_fname, false) && method_exists($ev_fname,$req_fun)){
static::$linktag = $req_fun=='index' ? $fname.'/' : $fname.'/'.$req_fun;
if($req_fun != 'init' && method_exists($ev_fname,'init')){
$ev_fname::init();
}
$ev_fname::$req_fun();
}else if( class_exists($ev_fname, false) && method_exists($ev_fname,'index') ){
static::$linktag = $fname.'/';
if(method_exists($ev_fname,'init')){
$ev_fname::init();
}
$ev_fname::index();
}else if( $fname != 'index' && class_exists(static::$pretag.'index', false) && method_exists(static::$pretag.'index','index') ){
$ev_fname = static::$pretag.'index';
static::$linktag = 'index/';
if(method_exists($ev_fname,'init')){
$ev_fname::init();
}
$ev_fname::index();
}else{
self::__msg('Function Not Exist!');
}
}
}
self::__end();
}

//这里是用户自定义链接的解析(用数据库教程存储的解析值) 如: xiaoming.baidu.com

//数据库中 xiaoming这个标签指向一个人的博客 就会到了www.baidu.com/blog?uid=12或www.baidu.com/blog?uname=xiaoming(这个就看自己咋设计数据库了)

public static function __goto($para = '',$path = ''){
$w = static::$website_path;
if(empty($para)){
exit('未知链接,解析失败,不能访问');
}
if(class_exists('Parseurl')){
$prs = Parseurl::selectone(array('tag','=',$para));
self::__msg($prs);
if(!empty($prs)){
$parastr = $prs['tag'];
$output = array();
$_GET[$prs['idtag']] = $prs['id'];
parse_str($prs['parastr'], $output);
$_GET = array_merge($_GET,$output);
$path = $prs['type'].'/'.preg_replace('|^/'.$prs['type'].'|','',$path);
self::__msg($path);
header('location:'.$w.$path.'?'.http_build_query($_GET));
exit();
}else{
header("location:".$w);
exit();
}
}else{
header("location:".$w);
exit();
}
}
}
?>

[!--infotagslink--]

相关文章

  • c#自带缓存使用方法 c#移除清理缓存

    这篇文章主要介绍了c#自带缓存使用方法,包括获取数据缓存、设置数据缓存、移除指定数据缓存等方法,需要的朋友可以参考下...2020-06-25
  • IDEA中的clean,清除项目缓存图文教程

    这篇文章主要介绍了IDEA中的clean,清除项目缓存图文教程,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...2020-09-25
  • AngularJS实现Model缓存的方式

    这篇文章主要介绍了AngularJS实现Model缓存的方式,分享了多种AngularJS实现Model缓存的方法,感兴趣的小伙伴们可以参考一下...2016-02-05
  • iOS蓝牙设备名称缓存问题的解决方法

    这篇文章主要给大家介绍了关于iOS蓝牙设备名称缓存问题的解决方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧...2020-12-08
  • Nodejs下DNS缓存问题浅析

    本文给大家一起探讨nodejs下dns的缓存问题,本文给大家介绍的非常详细,感兴趣的朋友一起看看吧...2016-11-22
  • PHP的运行机制与原理(底层)

    说到php的运行机制还要先给大家介绍php的模块,PHP总共有三个模块:内核、Zend引擎、以及扩展层;PHP内核用来处理请求、文件流、错误处理等相关操作;Zend引擎(ZE)用以将源文件转换成机器语言,然后在虚拟机上运行它;扩展层是一组...2015-11-24
  • @CacheEvict + redis实现批量删除缓存

    这篇文章主要介绍了@CacheEvict + redis实现批量删除缓存方式,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教...2021-10-12
  • vue项目中禁用浏览器缓存配置案例

    这篇文章主要介绍了vue项目中禁用浏览器缓存配置案例,本篇文章通过简要的案例,讲解了该项技术的了解与使用,以下就是详细内容,需要的朋友可以参考下...2021-09-12
  • python怎么删除缓存文件

    在本篇文章里小编给大家整理的是一篇关于python删除缓存文件方法,需要的朋友们可以学习下。...2020-07-19
  • IIS7、iis7.5中禁止缓存单个静态文件的配置方法

    这篇文章主要介绍了IIS7、iis7.5中禁止缓存单个静态文件的配置方法,需要的朋友可以参考下...2017-07-06
  • java中Base64编码原理实例讲解

    这篇文章主要介绍了java中Base64编码原理实例讲解,文章讲解的很清晰,有对于这方面不太懂的同学可以研究下...2021-02-10
  • Vue中key的作用及原理详解

    本文主要介绍了Vue3中key的作用和工作原理,文中通过示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...2021-10-13
  • 强制页面不缓存的方法

    页面不缓存可以让我们有更新就立即更新出来用户不需要清除浏览器缓存或不停的按f5刷新了,这里整理了解一些关于页面不缓存的方法,具体的如下。 一,js,css,图片文件不...2016-09-20
  • SpringCache 分布式缓存的实现方法(规避redis解锁的问题)

    这篇文章主要介绍了SpringCache 分布式缓存的实现方法(规避redis解锁的问题),本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下...2020-11-20
  • 安卓手机如何清理缓存

    小编给大家带来一篇关于安卓手机缓存怎么清理的问题解答,有需要的可以参考一下 &#8195;&#8195;安卓手机怎么清理缓存 android清除程序缓存的方法&#8195;&#8195;一,...2017-07-06
  • C# URL短地址压缩算法及短网址原理解析

    这篇文章主要介绍了C# URL短地址压缩算法及短网址原理解析,本文重点给出了算法代码,需要的朋友可以参考下...2020-06-25
  • 解决vue单页面 回退页面 keeplive 缓存问题

    这篇文章主要介绍了解决vue单页面 回退页面 keeplive 缓存问题,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...2020-07-22
  • C++开发在IOS环境下运行的LRUCache缓存功能

    本文着重介绍如何在XCODE中,通过C++开发在IOS环境下运行的缓存功能。算法基于LRU,最近最少使用,需要的朋友可以参考下...2020-04-25
  • PHP之深入学习Yii2缓存Cache组件详细讲解

    这篇文章主要介绍了PHP之深入学习Yii2缓存Cache组件详细讲解,本篇文章通过简要的案例,讲解了该项技术的了解与使用,以下就是详细内容,需要的朋友可以参考下...2021-07-27
  • 在Visual Studio 中使用git及Git概念

    Git是一个开源的分布式版本控制系统,可以有效、高速的处理从很小到非常大的项目版本管理,是目前使用范围最广的版本管理工具,本文重点给大家介绍在Visual Studio 中使用git及git的工作原理,感兴趣的朋友一起看看吧...2021-05-19