Support » Plugin: WP Super Cache » Serve static assets with an efficient cache policy

  • Resolved tmweb

    (@tmweb)


    Hi,
    I have Supercache installed on my site and I have preload turned on. However, when I check my site on Lighthouse in Chrome, I still get the message ”
    Serve static assets with an efficient cache policy” and it lists several pages that are not cached.

    How can I fix this?

    TM

Viewing 2 replies - 1 through 2 (of 2 total)
  • G

    (@gnetworkau)

    This is not related to HTML pages or Supercache. It means your static assets – stylesheet files (.css) and javascript files (.js) don’t have efficient cache policy.
    If you are on Apache server and know how to edit .htaccess, add this to it for a 1 month expiry:

    # Cache Control and Enable CORS
    <FilesMatch "\.(js|css|jpg|gif|png|pdf|swf|svg|svgz|ico|ttf|ttc|otf|eot|woff|woff2|webp)$">
     <IfModule mod_headers.c>
        ExpiresActive On
        ExpiresDefault  "access plus 1 month"
        Header set Cache-Control "public, immutable, max-age=2628000, s-maxage=2628000"
        Header set Access-Control-Allow-Origin "*"
     </IfModule>
    </FilesMatch>

    Alternately, install HTTP Headers plugin, and go to the section “Cache Control” and/or “Expiry”, and enter similar options to those appearing above. Make sure you are using Supercache in “Simple” (Recommended) mode or this won’t work.
    I haven’t used that plugin for ages, so just check it is applying the cache control to CSS and JS, not just HTML…

    Thanks for the information. Will see if it helps improve page speed.

    TM

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Serve static assets with an efficient cache policy’ is closed to new replies.