• Hi,
    I checked my site’s speed using Google PageSpeed Insights

    I am already using following plugins for the Page Speed:
    1. Above The Fold Optimization
    2. Autoptimize
    3. Leverage Browser Caching
    4. Remove Query Strings From Static Resource
    5. WP Smush

    I am also using Yoast SEO and updated the .htacess file with following code

    <filesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
    Header set Cache-Control "max-age=84600, public"
    </filesMatch>
    
    # LBROWSERCSTART Browser Caching
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType text/javascript "access 1 month"
    ExpiresByType text/html "access 1 month"
    ExpiresByType application/javascript "access 1 month"
    ExpiresByType application/x-javascript "access 1 month"
    ExpiresByType application/xhtml-xml "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresDefault "access 1 month"
    </IfModule>
    # END Caching LBROWSERCEND
    

    While I checked my site’s speed using Google’s PageSpeed Insights I am still getting the Possible Optimization Suggestion on Leverage Browser Caching for following

    
    https://platform.twitter.com/widgets.js (30 minutes)
    https://connect.facebook.net/en_US/sdk.js (20 minutes)
    https://[MY BLOG URL GOES HERE]/wp-content/themes/Avada/includes/lib/assets/fonts/icomoon/icomoon.woff (expiration not specified)
    https://www.google-analytics.com/plugins/ua/linkid.js (60 minutes)
    https://www.google-analytics.com/analytics.js (2 hours)
    

    So where to write the specific code for the above suggestion?

    Additionally:
    I also checked individual pages and for each pages, Google has certain suggestions. So is there any method to generalize it?

Viewing 2 replies - 1 through 2 (of 2 total)
  • As far as I know .woff is already compressed either way so you can’t do anything extra about it. You could try adding it to the htaccess file list though for example if there’s a chance to cache it as well.

    <filesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf|woff)$">

    As for the external .js libraries since they are external caching is not up to you and Google will always error out on them. They always do on analytics and every other .js that is by them even so don’t worry about those.

    If you are trying to reach the 100% there are other ways to make analytics not looking up for those files but that’s a different story and it doesn’t actually do any ‘speed difference’ since it’s only for the PageSpeed Insights.

    Thread Starter joshibhargav20

    (@joshibhargav20)

    Hi @xkon
    Thanks for your reply.

    Actually, the client always ask for the 100% (or almost to the 100%)
    They check the page speed using Google Page Speed Insights and Analytics, and then they are getting the same message which I described above.

    It is difficult to make them understand about the external javascript libraries.

    My one page has Gleam Giveaway app, so if someone is on the Giveaway page and making an entry, then Google also considers the total time in page loading time. This results in increasing amount of Average Loading Time in Google Analytics.

    So do you know how to solve such things? Could you share which are the other ways to reach 100% (or almost to the 100%)?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Leverage Browser Caching using .htacess file’ is closed to new replies.