• Resolved Ironos

    (@irongenetics96)


    I started using WP Cloudflare Super Page Cache today and went through all advanced settings.
    However, I am facing two issues:

    1. Browser Cache not working
      • I enabled the option “Add browser caching rules for static assets” in the settings.
      • I am using Apache as the web server.
      • Nothing is being added inside the .htaccess file, tried it also on a separate wordpress installation. Old cache plugin which i used wrote into htaccess with no problem
      • Google PageSpeed still reports: “Use efficient cache retention time”.
        Could you please explain why the browser caching rules are not applied automatically, and if there is something else I need to configure manually?
    2. wp-config.php permissions
      • The plugin adds define('WP_CACHE', true); into wp-config.php without an error when the file permission is set to 644.
      • But as soon as I change wp-config.php back to 444, the plugin shows an error: The file wp-config.php is not writable. Please add write permission to activate the fallback cache.
      • Why does the plugin always require wp-config.php to be writable, instead of only once during the initial setup?

    I would really appreciate your guidance on both issues:

    • How to properly enable browser cache rules for static assets.
    • Why the plugin keeps requiring write permission for wp-config.php.

    Thank you in advance for your help!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Ironos

    (@irongenetics96)

    The main problem is: Nothing is added inside htaccess from your plugin no matter what i do.
    Also tried this plugin on new wordpress installation but nothing.
    Never had this problem so far, i am trying to fix this problem since hours, i thought it´s easy to set up this plugin

    Robert Soare

    (@soarerobertdaniel7)

    Hello,

    If the .htaccess file hasn’t been updated, this typically means the plugin doesn’t have the necessary permissions to modify it.

    You can check the wp-content/wp-cloudflare-super-page-cache/<your_domain>/nginx.conf content and the following settings for “Add browser caching rules for static assets”  should be present:

    <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>

    If this is present but .htaccess is not modified, it might confirm issues with write access.

    But as soon as I change wp-config.php back to 444, the plugin shows an error: The file wp-config.php is not writable. Please add write permission to activate the fallback cache.

    This is a warning to prevent further issues when activating/deactivating the cache.

    Thread Starter Ironos

    (@irongenetics96)

    Inside wp-content/wp-cloudflare-super-page-cache/<your_domain>/nginx.conf

    There is

    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/aurandus.com/debug.log { access_log off; deny all; }

    My .htaccess which is under /domainname/htacces has 644 and NOTHING is written inside.

    I also installed now again a new wordpress installation with only super page cache, here is still same problem. This plugin isn´t writing anything inside htaccess.

    Funfact: I tried to deinstall this plugin on my test wordpress installation and got a warning “Deletion failed: There was a critical error on your website. Learn more about troubleshooting in WordPress.”

    I also installed another Cache Plugin on Test installation and it writes into htaccess without a Problem.

    So there must be a serious problem with your plugin, not only .htaccess isn´t working, also deinstalling this Plugin is a big Problem.

    Since a week i try to configure this Plugin and i am dissapointed.

    So is there any fix for both issues?

    Thread Starter Ironos

    (@irongenetics96)

    I have APACHE as webserver.

    Btw i am using WordPress since 10 years and it´s the first time having so much problems with a plugin.

    Also not able to uninstall a plugin is a big nogo.

    • This reply was modified 9 months, 2 weeks ago by Ironos.
    Robert Soare

    (@soarerobertdaniel7)

    @irongenetics96 I got confirmation from the developers that there is a bug with the way the plugin is trying to modify the .htaccess file.

    Also, the uninstall problem is another confirmed regression.

    Both issues will be fixed in the next release.

    Sorry for the inconvenience and thanks again for the collaboration.

    Hi @irongenetics96,

    Thank you once again for reporting the issues.
    Today we made a patched release of the plugin where mentioned issues were addressed.

    Thread Starter Ironos

    (@irongenetics96)

    Thanks, finally i can use your plugin. I will open up another thread because i have some questions about the preloader feature.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Browser Caching not working’ is closed to new replies.