• Resolved hughforsyth

    (@hughforsyth)


    Hi Frank,

    I’ve got a small compatibility issue with SuperCache. Is there any way to specify a different directory for the cache files?

    I recently updated to 1.70 and enabled the “Save aggregated script/css as static files” which I really like? I’ve now switched this off.

    The problem is that the max age was being set to 3 seconds. This ws being set by Supercache which adds the following .htaccess file to /wp-content/cache/ directory (and therefore /wp-content/cache/autoptimize).

    # BEGIN supercache
    <IfModule mod_mime.c>
    <FilesMatch “\.html\.gz$”>
    ForceType text/html
    FileETag None
    </FilesMatch>
    AddEncoding gzip .gz
    AddType text/html .gz
    </IfModule>
    <IfModule mod_deflate.c>
    SetEnvIfNoCase Request_URI \.gz$ no-gzip
    </IfModule>
    <IfModule mod_headers.c>
    Header set Vary “Accept-Encoding, Cookie”
    Header set Cache-Control ‘max-age=3, must-revalidate’
    </IfModule>
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/html A3
    </IfModule>

    # END supercache

    It’s not a fault with your plugin and maybe SuperCache should put the .htaccess in /wp-content/cache/supercache/. But an easy fix would be for me to move the Autoptimize folder to /public_html/wp-content/autoptimize.

    I’ve tried worked around this by adding a .htaccess file to /public_html/wp-content/cache/autoptimize. This worked but got deleted whenever I purged the Autoptimize cache.

    I’ve now switched back to dynamic but it would be nice to switch it back on..

    Thank you for your plugin. It’s great and the only minify I’ve ever been able to get to work well.

    The site is https://www.unitedworldschools.org/

    Thanks

    https://www.ads-software.com/plugins/autoptimize/

Viewing 11 replies - 76 through 86 (of 86 total)
  • No I don’t it was a part of the theme

    Plugin Author Frank Goossens

    (@futtta)

    can you in that case disable javascript-optimization in autoptimize, so I can check which javascript is used there? that way I should be able to tell you what to add in the “exclude”-js-field.

    Thank you Frank, I have unchecked the box which says optimized java script

    Plugin Author Frank Goossens

    (@futtta)

    OK, try turning JS optimization back on, with this added (as I guess you already have some exclusions there) to the JS exclusion list;

    jquery.js, scripts.js

    if you already have some strings there, add a comma to seperate each exclusion.

    Thank you Frank, I have there already this

    s_sid,smowtion_size,sc_project,WAU_,wau_add,comment-form-quicktags,edToolbar,ch_client

    I have added that behind. I have also viewed the map and seems to be fine I just do not understand how comes that the social plugins are on the top.

    Plugin Author Frank Goossens

    (@futtta)

    Glad it works. The social buttons were also on top without JS optimization.

    That’s weird..let it be there then:-) Thank you very much Frank. As always great support!

    Just thinking outside the box. What if I just add a .htaccess file to the cache/supercache folder that correctly sets the text/html Expires header. That should work too, right? Here’s what I’m thinking:

    # BUGFIX 3 second header expiration in wp super cache
    <IfModule mod_headers.c>
      Header set Vary "Accept-Encoding, Cookie"
      Header set Cache-Control 'max-age=3600, must-revalidate'
    </IfModule>

    I’ll just need to remember to remove it once this is fixed. Any idea if Donncha will make this expires header a UI feature so we can set it to as far future as we like? Or automatically have it get set based on the Preload and Garbage collection timer?

    Plugin Author Frank Goossens

    (@futtta)

    Hi James;
    Although the bug is still in the wp super cache .htaccess, Autoptimize now has it’s own .htacccess which overrides WPSC’s for requests for JS/ CSS.

    That being said the problem off course is still present for HTML as cached by WPSC (outside of the Autoptimize cache-folder). The code you have there should work, but will force all files to have a max-age of 1h, not just text/html.

    Hope this helps,
    frank

    Am I right in thinking that the only files served from the supercache directory are text/html?

    I’ll have to check out autoptimize. That might eliminate a hack I had to do to the Better WordPress Minify’s min confg file to manually set expires headers.

    Unrelated: man, this SEO stuff is crazy! You could spend all day, every day just on one site. I was banging my head against the wall trying to figure out why I had a bad score for cookie-free domain. Then I realized it was the Cloudflare service tacking on a cookie to help them discern legit requests from users who had already gotten served something from their servers.

    Plugin Author Frank Goossens

    (@futtta)

    Although most files will be text/html, that will not always be the case, the most obvious exception being rss (which is text/xml).

    And the head-banging, yeah … Never been too fond of Cloudflare though, I consider it pretty invasive. But it does produce fast sites ??

Viewing 11 replies - 76 through 86 (of 86 total)
  • The topic ‘Expires/Max Age compatibility with SuperCache’ is closed to new replies.