偶然从网上看到的简单代码 缓存页面的 很不错 记录下 当然公司用的更犀利 不外发得说
$cachefile = 'cache.html';
$cachetime = 4 * 60;
// Serve from the cache if it is younger than $cachetime
if (file_exists($cachefile) && time() - $cachetime < filemtime($cachefile)) {
include($cachefile);
echo "\n";
exit;
}
ob_start(); // Start the output buffer
/* Heres where you put your page content */
// Cache the contents to a file
$cached = fopen($cacheFile, 'w');
fwrite($cached, ob_get_contents());
fclose($cached);
ob_end_flush(); // Send the output to the browser
内容出自:http://papermashup.com/caching-dynamic-php-pages-easily/
phpcms 外部数据源调用
错误
{pc:get sql="SELECT * FROM expert_expert" num="10" dbsource= "db_cms" return="data"}
正确
{pc:get sql="SELECT * FROM expert_expert" rows="10" dbsource="db_cms" return="data"}
mysql 用的一些命令[没有看过书的人就是2 我表示 我又一次2了]
explain
show processlist
kill id
/usr/local/mysql/bin/mysqldump -h127.0.0.1 -P3306 -uroot -ppass dbname tablename > table.sql
mysql备份
grep -R '内容' ./
grep查询
😯 博主,不知道你还记得我否?我刚才用谷歌站长检查发现,你的网站一直有连接到我的博客去。而我这边却没有你返还给你的连接。
看来是我之前整理连接时误删了,实在不好意思。我现在重新添加了。
记得 最近很少写博客 也很少逛博客 太懒了 没事;)