Support » Plugin: W3 Total Cache » Browser cache not following htaccess rule.

  • Resolved wpsubash


    This is my htaccess configuration generated by W3TC:

    <IfModule mod_expires.c>
    ExpiresActive On

    # Images
    ExpiresByType image/jpeg “access plus 1 year”
    ExpiresByType image/gif “access plus 1 year”
    ExpiresByType image/png “access plus 1 year”
    ExpiresByType image/webp “access plus 1 year”
    ExpiresByType image/svg+xml “access plus 1 year”
    ExpiresByType image/x-icon “access plus 1 year”

    # Video
    ExpiresByType video/webm “access plus 1 year”
    ExpiresByType video/mp4 “access plus 1 year”
    ExpiresByType video/mpeg “access plus 1 year”

    # Fonts
    ExpiresByType font/ttf “access plus 1 year”
    ExpiresByType font/otf “access plus 1 year”
    ExpiresByType font/woff “access plus 1 year”
    ExpiresByType font/woff2 “access plus 1 year”
    ExpiresByType application/font-woff “access plus 1 year”

    # CSS, JavaScript
    ExpiresByType text/css “access plus 1 month”
    ExpiresByType text/javascript “access plus 1 month”
    ExpiresByType application/javascript “access plus 1 month”

    # Others
    ExpiresByType application/pdf “access plus 1 month”
    ExpiresByType image/ “access plus 1 year”

    I guess this is enough for the browser cache configuration, but google pagespeed insight still diagnoses “Serve static assets with an efficient cache policy” issue. I talked to stackpath CDN enabled to deliver various resources like css,js and images. I talked to the CDN representatives and followed everything they to told, still I am not able to solve this problem. What can be the problem here? Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Marko Vasiljevic


    Hello @wpsubash

    Thank you for your inquiry and I am happy to assist you with this.
    First of all, this is not generated by W3 Total Cache so those are either some custom rules or from some other plugin.
    The W3TC .htaccess rules start with # BEGIN W3TC Browser Cache and end with # END W3TC Browser Cache and it does and expires in years or months but in seconds.
    Please shares your website URL so I can check what google page speed is complaining about. Make sure you are not using any other plugin for this or any custom rules to avoid conflict with W3TC rules. Make sure that all needed options are enabled in Performance>Browser Cache and also make sure that the Browser Cache itself is active in PErformance>General settings.

    Thread Starter wpsubash


    Hi @vmarko. Thank you for responding.

    Yes, I looked closely and found out it is not generated by W3TC. Is this the reason why Browser Cache feature enabled inside W3TC plugin is not working because of the custom rule? Also there is no other plugin for this purpose and I have enabled everything.

    Here you go:

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Browser cache not following htaccess rule.’ is closed to new replies.