WP Cloudflare Super Page Cache – Nginx Settings
-
Thanks for this amazing plugin, no doubt the best in the following to work aligned in sync with cloudflare is amazing your work congratulations!
But I have some difficulties to be able to go forward:
Plugin recommends performing following extra configurations but in a very generic way without detailed guidance for novices this makes this procedure complex and daunting.
Please could help with detailed tutorial article or step-by-step video on how to implement each setting below in nginx:
WP Cloudflare Super Page Cache - Nginx Settings Overwrite the cache-control header Edit the main Nginx configuration file, usually /etc/nginx.conf, and enter these rules immediately after opening the http block: map $upstream_http_x_wp_cf_super_cache_active $wp_cf_super_cache_active { default 'no-cache, no-store, must-revalidate, max-age=0'; '1' 's-maxage=31536000, max-age=60'; } Now open the configuration file of your domain and add the following rules inside the block that deals with the management of PHP pages: more_clear_headers 'Pragma'; more_clear_headers 'Expires'; more_clear_headers 'Cache-Control'; add_header Cache-Control $wp_cf_super_cache_active; Save and restart Nginx. Browser caching rules Open the configuration file of your domain and add the following rules: location ~* \.(xml|xsl)$ { add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0"; expires -1; } location /robots.txt { add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0"; expires -1; } location ~* \.(css|js|pdf)$ { add_header Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=2592000, stale-while-revalidate=86400, stale-if-error=604800"; expires 30d; } location ~* \.(jpg|jpeg|png|gif|ico|eot|swf|svg|webp|avif|ttf|otf|woff|woff2|ogg|mp4|mpeg|avi|mkv|webm|mp3)$ { add_header Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=31536000, stale-while-revalidate=86400, stale-if-error=604800"; expires 365d; } location /wp-cron.php { add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0"; expires -1; } location = /wp-content/wp-cloudflare-super-page-cache/mysite.com.br/debug.log { access_log off; deny all; } Save and restart Nginx.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘WP Cloudflare Super Page Cache – Nginx Settings’ is closed to new replies.