秀米云香港服务器

WP Super Cache是今朝缓存插件利用的最多的一个,在我的WordPress缓存优化中并未提起,但并不代表WP Super Cache欠好。出格是nginx下面,其实是由于WP Super Cache在nginx安装利用,和URL重写即伪静态法则相对在apache下面更难配置。

安装与配置WP Super Cache

序列号 CPU RAM HDD 带宽 售价(美元) 免费试用
香港服务器1 E5-2620 32G 1T HDD 50M/无限流量 $196.00 立即申请
香港服务器2 E5-2650 32G 1T HDD 50M/无限流量 $256.00 立即申请
香港服务器3 E5-2680 32G 1T HDD 50M/无限流量 $316.00 立即申请
香港服务器4 E5-2690 32G 1T HDD 50M/无限流量 $336.00 立即申请
香港服务器5 E5-2697 32G 1T HDD 50M/无限流量 $376.00 立即申请
香港服务器6 E5-2620*2 32G 1T HDD 50M/无限流量 $376.00 立即申请
香港服务器7 E5-2650*2 32G 1T HDD 50M/无限流量 $436.00 立即申请
香港服务器8 E5-2680*2 32G 1T HDD 50M/无限流量 $476.00 立即申请
香港服务器9 E5-2690*2 32G 1T HDD 50M/无限流量 $556.00 立即申请
香港服务器10 E5-2697*2 32G 1T HDD 50M/无限流量 $596.00 立即申请
香港服务器11 E5-2680v4*2 32G 1T HDD 50M/无限流量 $696.00 立即申请
香港服务器12 E5-2698v4*2 32G 1T HDD 50M/无限流量 $796.00 立即申请

在WordPress仪表盘插件栏搜索WP Super Cche,,安装即可。

安装WP Super Cache

启用缓存成果 (推荐)

启用后,会呈现提示:

Modrewrite模块大概未安装!

貌似mod_rewrite模块尚未安装。也许环境并不是这样,尤其是当您不利用Apache作为处事器措施的时候。请查抄mod_rewrite模块是否被加载。这对付SuperCache的静态文件的挪用是必须的。不外您可以利用PHP缓存模式可能传统模式运行本插件。

不消管这个提示,这是针对apache处事器的提示,nginx下面不消管它。

高级配置勾选项 WP Super Cache的nginx url重写法则

将本来的nginx重写法则

try_files$uri$uri//index.php?$args;

修改为

try_files/wp-content/cache/supercache/$http_host/$cache_uri/index.html$uri$uri//index.php?$args;

server{....}

中间插入

#WPSuperCacherules.#Designedtobeincludedfroma'wordpress-ms-...'configurationfile.set$cache_uri$request_uri;#POSTrequestsandurlswithaquerystringshouldalwaysgotoPHPif($request_method=POST){set$cache_uri'nullcache';}if($query_string!=""){set$cache_uri'nullcache';}#Don'tcacheuriscontainingthefollowingsegmentsif($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'nullcache';}#Don'tusethecacheforloggedinusersorrecentcommentersif($http_cookie~*"comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in"){set$cache_uri'nullcache';}#STARTMOBILE#Mobilebrowserssectiontoserverthemnon-cachedversion.COMMENTEDbydefaultasmostmodernwordpressthemesincludingtwenty-elevenareresponsive.UncommentconfiglinesinthissectionifyouwanttouseapluginlikeWP-Touch#if($http_x_wap_profile){#set$cache_uri'nullcache';#}#if($http_profile){#set$cache_uri'nullcache';#}#if($http_user_agent~*(2.0MMP|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|NintendoWii|Nitro|Nokia|OperaMini|Palm|PlayStationPortable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|SymbianOS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|WindowsCE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915Obigo|LGEVX|webOS|Nokia5800)){#set$cache_uri'nullcache';#}#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'nullcache';#}#ENDMOBILE

千万不要插在

location/{....}

中间。

检讨是否生效

重启nginx,查察网页源码,底部是否增加了雷同如下的注释,假如有即代表乐成。

标题:WP Super Cache在Nginx下安装要领和URL重写(伪静态)法则配置

地址: https://www.yunhk.xyz/26020.html