WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: W3 Total Cache] no mod_expires by default (6 posts)

  1. techotronic
    Member
    Posted 4 years ago #

    Hi,
    Apache2 does not install mod_expires by default. Unfortunately, my provider does not install mod_expires for my apache installation.
    Therefore, no expiration date is added for e.g. the minified CSS and JS files:

    <IfModule mod_expires.c>
        ExpiresActive On
        ExpiresByType text/css M86400
        ExpiresByType application/x-javascript M86400
    </IfModule>
    <IfModule mod_headers.c>
        Header set Pragma public
        Header set X-Powered-By "W3 Total Cache/0.8.5.2"
        Header set Vary "Accept-Encoding"
        Header append Cache-Control "public, must-revalidate, proxy-revalidate"
    </IfModule>

    Could you please change the default .htaccess to:

    <IfModule mod_headers.c>
        Header set Pragma public
        Header set X-Powered-By "W3 Total Cache/0.8.5.2"
        Header set Vary "Accept-Encoding"
        Header set Cache-Control "max-age=2592000, public, must-revalidate, proxy-revalidate"
    </IfModule>

    Since the files are considered to be static cacheable, algorithms like the Google Pagerank want the files to be cacheable for 30 days, shorter periods of time lead to a decrease of the score.

    I already changed my .htaccess file like I described above, but W3 Total Cache always overwrites it...

    Best regards,
    Arne

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. Frederick Townes
    Member
    Posted 4 years ago #

    The expiration value is determined by your update interval setting. Do you have documentation on your google reference?

  3. techotronic
    Member
    Posted 4 years ago #

    Hi Frederick,

    @expiration date value:
    thanks I would never have guessed that setting the "Update external files every:" property would influence the values in the htaccess files. I thought that would be the interval in which the plugin itself updates external resources and minifies them again...

    The description should probably be something like "Specify the lifetime of cached files in external caches like proxy servers and browsers" instead of "Specify the interval between download and update of external files in the minify cache."
    Or maybe that's just me ;-)

    Unfortunately, that does not solve my problem, I can't use mod_expires, so the headers are not set in the first place. I would either like the plugin to not use mod_expires at all, or at least let me edit the .htaccess files without constantly overwriting them.
    Would one of those options be feasable?

    @Google reference:
    I was playing around with Google Page Speed, Yslow and several external speed test websites, and if I don't set "max-age=2592000" they all complained about static cacheable files being cached too short. After setting the max-age to 30 days, the overall score was always higher than with a lower setting.
    May of course be coincidence...

    Best regards,
    Arne

  4. Frederick Townes
    Member
    Posted 4 years ago #

    It's not possible to satisfy ever performance test and all practical use cases. You can use memcached or APC for minify and the headers will be set by PHP.

  5. techotronic
    Member
    Posted 4 years ago #

    Hi Frederick,

    I can't use memcache or APC since I have a shared webhosting account. That is also the reason why I can't install mod_expires myself...

    Would it be possible to get rid of mod_expires? mod_headers does the same thing and is used anyways. I am probably not the only one with a default installation of Apache2 and no way of changing it.

    As I said, it would be sufficient if W3 Total Cache would not overwrite the .htaccess files after I change the headers.

    Best regards,
    Arne

  6. Frederick Townes
    Member
    Posted 4 years ago #

    The way the plugin works, if the modules do not exist then the directives are not used. I'm also using the modules as intended without hacks to ensure the maximum interoperability for users with hosts with full featured software.

Topic Closed

This topic has been closed to new replies.

About this Topic