Results 1 to 7 of 7
  1. #1
    edgarf76's Avatar
    edgarf76 is offline Private Member
    Join Date
    March 2013
    Location
    Montreal
    Posts
    2,196
    Thanks
    803
    Thanked 582 Times in 429 Posts

    Default Improving Leverage browser caching

    I am trying to Improve the Leverage browser caching on some domains that are taking longer to load than others. Is there a wordpress plugin that helps improve this? Something I can do manually? Any help would be appreciated!



    FYI - I have them all forwarded to cloudflare

  2. #2
    Pmig is offline Private Member
    Join Date
    August 2012
    Posts
    182
    Thanks
    44
    Thanked 77 Times in 54 Posts

    Default

    That is server side work (apache/nginx/etc), depending on what you are using you can use a .htaccess file (apache) to tweak some things... But is better if you that on httpd conf.

  3. #3
    edgarf76's Avatar
    edgarf76 is offline Private Member
    Join Date
    March 2013
    Location
    Montreal
    Posts
    2,196
    Thanks
    803
    Thanked 582 Times in 429 Posts

    Default

    The server is linux, how do I tweak it without messing it up?

  4. #4
    Pmig is offline Private Member
    Join Date
    August 2012
    Posts
    182
    Thanks
    44
    Thanked 77 Times in 54 Posts

    Default

    Right... and what is the httpd? apache/nginx/other?

  5. #5
    Moonlight Cat's Avatar
    Moonlight Cat is offline Private Member
    Join Date
    November 2008
    Posts
    1,990
    Blog Entries
    1
    Thanks
    1,236
    Thanked 1,181 Times in 676 Posts

    Default

    Quote Originally Posted by edgarf76 View Post
    I am trying to Improve the Leverage browser caching on some domains that are taking longer to load than others.
    I am not sure, but try to put .htaccess file and write in this file:

    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType text/html "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType text/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 1 month"
    </IfModule>
    ## EXPIRES CACHING ##
    <IfModule mod_deflate.c>
    # Compress HTML, CSS, JavaScript, Text, XML and fonts
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
    AddOutputFilterByType DEFLATE application/x-font
    AddOutputFilterByType DEFLATE application/x-font-opentype
    AddOutputFilterByType DEFLATE application/x-font-otf
    AddOutputFilterByType DEFLATE application/x-font-truetype
    AddOutputFilterByType DEFLATE application/x-font-ttf
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE font/opentype
    AddOutputFilterByType DEFLATE font/otf
    AddOutputFilterByType DEFLATE font/ttf
    AddOutputFilterByType DEFLATE image/svg+xml
    AddOutputFilterByType DEFLATE image/x-icon
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/javascript
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/xml


    # Remove browser bugs (only needed for really old browsers)
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    Header append Vary User-Agent
    </IfModule>

    p.s. after this site load very quick.

  6. The Following 3 Users Say Thank You to Moonlight Cat For This Useful Post:

    edgarf76 (10 December 2014), RacingJim (22 December 2014), TheGooner (10 December 2014)

  7. #6
    TheGooner's Avatar
    TheGooner is offline Private Member
    Join Date
    March 2007
    Location
    New Zealand
    Posts
    4,481
    Thanks
    2,066
    Thanked 4,459 Times in 2,128 Posts

    Default

    Thanks MoonlightCat - a very useful post.


    After reading your post - I just did a wee bit of research on those Expires by Type commands.

    I put in the following commands - and can see a MASSIVE improvement in speed for subsequent pages.
    It's got to be reducing the load on my server too! These settings should be standard.

    <IfModule mod_expires.c>
    ExpiresActiveOn
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType text/css "access plus 1 week"
    ExpiresByType text/javascript "access plus 1 week"
    ExpiresByType application/javascript "access plus 1 week"
    ExpiresByType application/x-javascript "access plus 1 week"
    ExpiresByType image/x-icon "access plus 1 year"
    </IfModule>

  8. The Following 2 Users Say Thank You to TheGooner For This Useful Post:

    edgarf76 (10 December 2014), RacingJim (22 December 2014)

  9. #7
    DanHorvat's Avatar
    DanHorvat is offline Private Member
    Join Date
    November 2008
    Location
    Actual location may vary.
    Posts
    1,962
    Blog Entries
    3
    Thanks
    1,385
    Thanked 1,305 Times in 771 Posts

    Default

    It's rarely that easy. Over the years I've tried every version of .htaccess found on the internet, and most of them had no effect or had limited effect. Especially when I wanted to add ETags.

    This is my version of .htaccess I'm using as a default in all my sites. I think it even gzips fonts. Try it out (backup first).

    Options +FollowSymLinks
    RewriteEngine On

    Header unset ETag
    FileETag None

    AddType font/ttf .ttf
    AddType font/otf .otf
    AddType application/x-woff .woff
    AddType image/svg+xml .svg
    AddType application/vnd.ms-fontobject .eot

    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType font/ttf "access plus 10 years"
    ExpiresByType font/otf "access plus 10 years"
    ExpiresByType application/vnd.ms-fontobject "access plus 10 years"
    ExpiresByType application/x-woff "access plus 10 years"
    ExpiresByType image/svg+xml "access plus 10 years"

    </IfModule>

    <IfModule mod_expires.c>
    <FilesMatch "\.(jpe?g|png|gif|js|css|ttf|eot|otf|svg)$">
    ExpiresActive On
    ExpiresDefault "access plus 1 week"
    </FilesMatch>
    </IfModule>

    <ifmodule mod_deflate.c="">
    # force deflate for mangled headers
    # developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
    <ifmodule mod_setenvif.c="">
    <ifmodule mod_headers.c="">
    SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
    RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
    </ifmodule>
    </ifmodule>

    # HTML, TXT, CSS, JavaScript, JSON, XML, HTC:
    <ifmodule filter_module="">
    FilterDeclare COMPRESS
    FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html
    FilterProvider COMPRESS DEFLATE resp=Content-Type $text/css
    FilterProvider COMPRESS DEFLATE resp=Content-Type $text/plain
    FilterProvider COMPRESS DEFLATE resp=Content-Type $text/xml
    FilterProvider COMPRESS DEFLATE resp=Content-Type $text/x-component
    FilterProvider COMPRESS DEFLATE resp=Content-Type $application/javascript
    FilterProvider COMPRESS DEFLATE resp=Content-Type $application/json
    FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xml
    FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xhtml+xml
    FilterProvider COMPRESS DEFLATE resp=Content-Type $application/rss+xml
    FilterProvider COMPRESS DEFLATE resp=Content-Type $application/atom+xml
    FilterProvider COMPRESS DEFLATE resp=Content-Type $application/vnd.ms-fontobject
    FilterProvider COMPRESS DEFLATE resp=Content-Type $image/svg+xml
    FilterProvider COMPRESS DEFLATE resp=Content-Type $application/x-font-ttf
    FilterProvider COMPRESS DEFLATE resp=Content-Type $font/opentype
    FilterChain COMPRESS
    FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no
    </ifmodule>

    <ifmodule !mod_filter.c="">
    # Legacy versions of Apache
    AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
    AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml
    AddOutputFilterByType DEFLATE application/atom+xml
    AddOutputFilterByType DEFLATE image/svg+xml application/vnd.ms-fontobject
    AddOutputFilterByType DEFLATE application/x-font-ttf font/opentype
    </ifmodule>
    </ifmodule>
    Backlink building and bespoke white hat SEO service available. PM for details.

  10. The Following User Says Thank You to DanHorvat For This Useful Post:

    edgarf76 (11 December 2014)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •