• Hello,
    I used this plugin for 5-6 years it has always been great.

    In january this year I installed wprocket which instead was crap and I deleted it and went back to supercache.

    But after that I noticed something strange, there is no more code being added in htaccess by your plugin. Before something like this or similar was being added:

    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access plus 1 year"
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/gif "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/pdf "access plus 1 month"
    ExpiresByType text/x-javascript "access plus 1 month"
    ExpiresByType application/x-shockwave-flash "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 year"
    ExpiresDefault "access plus 2 days"
    </IfModule>

    Furthermore when I crawl the website using a techseo crawler it finds: “no cache headers” on my website, and I do have Supercache installed and all settings as default.

    I am on the verge of changing again caching plugin, but I’d love to keep using supercache which worked so well for me in the past.

    Could you please tell me how to fix this?

Viewing 9 replies - 1 through 9 (of 9 total)
  • This plugin never added code like that to the .htaccess. You probably found it on a website but it’s good to have.

    The “no cache headers” thing is probably that the plugin adds certain headers to make sure that no (or little, I don’t remember now) caching is done by proxy servers or browsers so they always request a fresh copy from your server. You can enable the browser caching setting in the advanced settings page to maybe offset this.

    Thread Starter Deon

    (@deon-b)

    Hi,
    so you think I should have this code in htaccess in conjunction to your plugin:

    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access plus 1 year"
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/gif "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/pdf "access plus 1 month"
    ExpiresByType text/x-javascript "access plus 1 month"
    ExpiresByType application/x-shockwave-flash "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 year"
    ExpiresDefault "access plus 2 days"
    </IfModule>
    
    ## EXPIRES CACHING ##
    # compress text, HTML, JavaScript, CSS, and XML
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript

    And about the browser caching setting, you are saying that at the moment, with the default settings there is no browser caching?

    Yeah, they are good rules to have in place but if you change any uploaded jpg files without changing the filename the old files might be cached by proxy servers without you knowing.

    Yeah. WordPress itself doesn’t do browser caching AFAIR since everything is dynamic. It’s generally only for static files that web servers have browser caching. The rules above are for that exact purpose. It’s not on by default because it causes problems with some hosts. I don’t bother with it on my blog.

    Thread Starter Deon

    (@deon-b)

    So the code above is the exact same thing as enabling “browser caching” in the plugin’s settings?

    Thanks!

    No, as I said, this plugin doesn’t add code like that. The browser caching adds the correct “304 not modified” support for the pages served by the plugin.

    You can read up more about that sort of thing here: https://httpd.apache.org/docs/2.4/caching.html

    Thread Starter Deon

    (@deon-b)

    Ok thanks, I am trying to figure out if it’s a good idea to both add the code in htaccess + enable browser caching or either one of them. Do you have suggestions on this since you are specialized in this sort of topic?

    And second question, how can I double check the plugin is actually effectively caching at the moment?

    Thank you!

    Yup, it’s worth trying both.

    Try use the cache tester on the settings page to test caching. To test the browser caching you’ll probably just have to load the browser console and check the network tab. I guess it’ll probably show a 304 code when the server says a page hasn’t been updated. I can’t remember if WP Super Cache has a debug line saying it’s a 304..

    Thread Starter Deon

    (@deon-b)

    Anyway about the htaccess code you are suggesting both the

    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access plus 1 year"
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/gif "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/pdf "access plus 1 month"
    ExpiresByType text/x-javascript "access plus 1 month"
    ExpiresByType application/x-shockwave-flash "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 year"
    ExpiresDefault "access plus 2 days"
    </IfModule>

    and the:

    ## EXPIRES CACHING ##
    # compress text, HTML, JavaScript, CSS, and XML
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript

    ?

    By the way I went in Chrome developer tools > Applications > Cache
    following these instructions:
    https://developers.google.com/web/tools/chrome-devtools/storage/cache
    and Cache Storage is empty.

    When I go to Network I don’t see any cache tabs.

    Any suggestions?
    Thank you!

    Yes.

    That’s your local browser cache. I don’t have any suggestions.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Not caching’ is closed to new replies.