• I’m trying to get one or two small bits finished and I’ve got everything else sorted but when in Google PageSpeed, I get this warning for Leverage Browser Cache:

    Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network.

    http://www.my-domain.com/themes/wp-performer/js/core/core.php

    – Anyone have any thoughts at all?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    Most caching plugins, like http://wordpress.org/plugins/wp-super-cache/ provide this feature. I’m honestly not sure about doing it without a plugin, since I’ve always used cache plugins.

    Thread Starter thetruejoe90

    (@thetruejoe90)

    I dont want to use a plugin. I want to put the right piece into the htaccess file myself

    Thread Starter thetruejoe90

    (@thetruejoe90)

    plus, a cache plugin wont do this, I don’t think.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    A cache plugin will do that, but yes, you can totally do it on your own in .htaccess 🙂

    Looks like this:

    # Expired
    <IfModule mod_expires.c>
    <Filesmatch "\.(jp?eg|png|gif|ico|woff)$">
        ExpiresActive on
        ExpiresDefault "access 1 year"
    </Filesmatch>
    
    <Filesmatch "\.(css|js|swf|mov|mp3|mpeg|mp4|ogg|ogv|ttf|xml|svg|html)$">
        ExpiresActive on
        ExpiresDefault "access 1 month"
    </Filesmatch>
    
        ExpiresDefault "access 2 days"
    </IfModule>
    ## END EXPIRES ##
    Thread Starter thetruejoe90

    (@thetruejoe90)

    Nice one.

    That’s a smarter version of the many I’ve seen over the years, Mika.

    I’m assuming then that the …

    ExpiresDefault "access 2 days"

    … would look after the core.php file, yes?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How do I 'Leverage Browser Cache' this?’ is closed to new replies.