
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缓存的方法
- 比较简单实用高效的网站防止灌水和反爬虫方案
- nginx 开启http3 QUIC和配置Brotli压缩和反向代理的详细教程
- 使用301实现域名跳转到www包括https的3种方法
- 一款可视化适合小白的cdn构建系统
- nginx: [warn] "ssl_stapling" ignored, not supported告警
- nginx: [emerg] Solution to unknown directive "set_real_ip_from"
- 一款非常不错的扒站、网站采集工具-httrack