
Nginx使用Memcached缓存加速wordpress,秒开网站
Nginx使用Memcached缓存,秒速响应网站
这里以常用的wordpress博客程序为例
下面是Nginx使用Memcached缓存wordpress的代码
//跳过一些缓存,比如写作文章和后台地址
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
location / {
error_page 404 405 = @nocache;
if ( $query_string ) {
return 405;
}
if ( $request_method = POST ) {
return 405;
}
if ( $request_uri ~ "/wp-" ) {
return 405;
}
if ( $http_cookie ~ (wp-postpass|wordpress_logged_in|comment_author)_ ) {
return 405;
}
default_type text/html;
add_header X-Powered-By Cachetest;
set $memcached_key $host$uri;
memcached_pass localhost:11211;
}
//NOCACHE LOCATION##下面的代码是wordpress伪静态代码,其它地方请勿添加
location @nocache {
try_files $uri $uri/ /index.php?$args;
}
💘 相关文章
- 比较简单实用高效的网站防止灌水和反爬虫方案
- 不会配置nginx?这个在线配置nginx的网站非常方便
- nginx 反向代理后端并缓存数据的方法
- vanillaforums伪静态规则和memcached缓存的方法
- 合理设置服务器gzip实现网站加速
- 中文地址转英文在线翻译网站
- Configure nginx to only allow cloudflare's IP to connect to the server shell script
- 三条命令实现WordPress丝滑顺畅的压缩迁移方案
- 设置WordPress的附件图片地址为二级域名或其它一级域名的方法
- 强大的在线视频下载网站-savieo