- WordPress记住评论用户信息的js版本,直接操作cookie无视缓存,解决WP Super Cache不缓存留言用户WP Super Cache默认情况下是不会对网站留过言的用户缓存的,因为在WP Super Cache看来,留过言的用户就是已知用户了,WP Super Cache的默认设置是推荐对已知用户不缓存的,当然我们也可以修改设置让WP Super Cach...
- WordPress文章点击统计ajax版,兼容wp super cache缓存代码及插件一般情况下使用了wp super cache缓存插件后,文章点击统计就会变的失效了,不过采用ajax就可以解决问题。 第一步:在wordpress根目录下,新建ajax.php.内容如下 <?php define( 'DOING_AJAX', true ); requ...
- WP Super Cache与Memcache为WordPress提速(以阿里云OCS为例)用过Wordpress的朋友们都知道,这款程序是建立在大量的数据库动态查询的基础上的;通常,为了提高访问速度,我们都会采用一些缓存手段。最常用的缓存手段莫过于WP Super Cache插件,其本质是生成静态页面储存在硬...
- wordpress非插件实现生成静态缓存文件wordpress用户用的最多的缓存插件应该是WP Super Cache,利用WP Super Cache可以很方便的把网站生成静态缓存文件,实现加速效果。不过今天给大家分享的是wordpress非插件实现生成静态缓存文件的方法。<?phpd...
- wordpress报Uncaught TypeError: Object #has no method错误解决办法最近在本地搭建的系统上测试wordpress时,发现jquery报Uncaught TypeError: Object # has no method错误,网上有解答说是由于jquery库冲突造成的,但想到这个主题是目前网站正在用的(网站上没问题),除了自己加...
- WordPress开启Nginx fastcgi_cache缓存加速
WordPress开启Nginx fastcgi_cache缓存加速,这是一篇转载并整理的文章,只为备忘,文章内容大部分来源于张戈博客。 在希望使用Nginx缓存前需要查看一下你的Nginx是否编译了ngx_cache_purge 模块,如果没有则需要...
- 实现高性能wordpress ajax文章分页功能
wordpress实现高性能的ajax文章分页功能。首先我们需要对后端进行处理,使除了当前使用AJAX可以无刷新浏览外,还可以直接请求改变的URL后也可以正常浏览。方法是对使用pushState的AJAX的发送一个特殊的头,当后端...
- 简单实用的网站动静分离优化方案
简单实用的网站动静分离优化方案,这是一篇转载文章,自己收藏起来慢慢琢磨。 先啰嗦一下网站动静分离的概念和好处。 一、动静分离 我们的网站简单来说分为 2 种数据资源,一种是动态的数据,即 PHP 等程序语言实...
Ngnix配置完美支持WordPress wp-super-cache插件
Ngnix完美支持WordPress wp-super-cache插件的配置
修改WordPress的nginx配置文件
在server {}段中添加以下内容
# WP Super Cache rules. # Designed to be included from a 'wordpress-ms-...' configuration file. set $cache_uri $request_uri; # POST requests and urls with a query string should always go to PHP if ($request_method = POST) { set $cache_uri 'null cache'; } if ($query_string != "") { set $cache_uri 'null cache'; } # Don't cache uris containing the following segments if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") { set $cache_uri 'null cache'; } # Don't use the cache for logged in users or recent commenters if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") { set $cache_uri 'null cache'; } # START MOBILE # Mobile browsers section to server them non-cached version. COMMENTED by default as most modern wordpress themes including twenty-eleven are responsive. Uncomment config lines in this section if you want to use a plugin like WP-Touch # if ($http_x_wap_profile) { # set $cache_uri 'null cache'; #} #if ($http_profile) { # set $cache_uri 'null cache'; #} #if ($http_user_agent ~* (2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800)) { # set $cache_uri 'null cache'; #} #if ($http_user_agent ~* (w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-)) { # set $cache_uri 'null cache'; #} #END MOBILE # 下面这条是配合wp-super-cache的Ngnix伪静态规则location / { try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?$args ; }
Experimental modifications:
If you are using HTTPS, the latest development version of WP Super Cache may use a different directory structure to differentiate between HTTP and HTTPS. try_files line may look like below:
location / { try_files /wp-content/cache/supercache/$http_host/$cache_uri/index-https.html $uri $uri/ /index.php?$args ; }