For using browser cache you recommend adding some rules to the nginx config, but cloudways refuses to add them and suggested to ask for the htaccess rules that are not same. can you provide them?
– I don’t understand. Most cloudways servers are running Nginx. So, .htaccess
rules will not work on NGINX. I’m so confused. But anyways, here are the htaccess rules for static files browser cache:
# BEGIN WP Cloudflare Super Page Cache
# The directives (lines) between "BEGIN WP Cloudflare Super Page Cache" and "END WP Cloudflare Super Page Cache" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType text/xsl "access plus 0 seconds"
</IfModule>
<FilesMatch "\.(xml|xsl)$">
<IfModule mod_headers.c>
Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0"
</IfModule>
</FilesMatch>
<FilesMatch "robots\.txt">
<IfModule mod_headers.c>
Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0"
</IfModule>
</FilesMatch>
<FilesMatch "\.(css|js|pdf)$">
<IfModule mod_headers.c>
Header set Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=2592000, stale-while-revalidate=86400, stale-if-error=604800"
</IfModule>
</FilesMatch>
<FilesMatch "\.(jpg|jpeg|png|gif|ico|eot|swf|svg|webp|avif|ttf|otf|woff|woff2|ogg|mp4|mpeg|avi|mkv|webm|mp3)$">
<IfModule mod_headers.c>
Header set Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=31536000, stale-while-revalidate=86400, stale-if-error=604800"
</IfModule>
</FilesMatch>
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_URI} ^(.*)?/wp-content/wp-cloudflare-super-page-cache/www.nechakooptometry.ca/debug.log(.*)$
RewriteRule ^(.*)$ - [F]
</IfModule>
<FilesMatch "wp-cron.php">
<IfModule mod_headers.c>
Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0"
</IfModule>
</FilesMatch>
# END WP Cloudflare Super Page Cache
on admin pages, some actions are not performed like deleting some export setting from export plugin. When click delete y load the page exactly the same as before. I guess some caching is happening in backend! im using worker mode. can you guide me to solve it ?
– Can you share a screen recording oof the issue?