Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
disable pagespeed cache on certain url
Browse files Browse the repository at this point in the history
  • Loading branch information
noogen committed May 1, 2019
1 parent be2f973 commit 53f53b9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rootfs/sysprepz/nginx-templates/php-fpm.stpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ server {
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;

if ($no_cache = 1) {
pagespeed Disallow "*";
}
}

error_page 403 /error/404.html;
Expand Down
5 changes: 5 additions & 0 deletions rootfs/sysprepz/nginx-templates/php-fpm.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ server {
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;

if ($no_cache = 1) {
pagespeed Disallow "*";
}
}


error_page 403 /error/404.html;
error_page 404 /error/404.html;
Expand Down
5 changes: 5 additions & 0 deletions rootfs/sysprepz/nginx-templates/wordpress.stpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ server {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;
pagespeed unplugged;
}

# only cache GET method
Expand Down Expand Up @@ -71,6 +72,10 @@ server {
fastcgi_cache fpm_%domain%;
fastcgi_cache_valid 404 1m;
fastcgi_cache_valid 200 45m;

if ($no_cache = 1) {
pagespeed Disallow "*";
}
}

location ~ /wp-config\.php {
Expand Down
5 changes: 5 additions & 0 deletions rootfs/sysprepz/nginx-templates/wordpress.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ server {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
pagespeed unplugged;
}

# only cache GET method
Expand Down Expand Up @@ -70,6 +71,10 @@ server {
fastcgi_cache fpm_%domain%;
fastcgi_cache_valid 404 1m;
fastcgi_cache_valid 200 45m;
if ($no_cache = 1) {
pagespeed Disallow "*";
}
}

location ~ /wp-config\.php {
Expand Down

0 comments on commit 53f53b9

Please sign in to comment.