1. This website uses cookies to improve service and provide a tailored user experience. By using this site, you agree to this use. See our Cookie Policy.
    Dismiss Notice

Levarage Browsing Cache

Discussion in 'White Hat SEO' started by El Magico, Feb 4, 2018.

  1. El Magico

    El Magico Junior Member

    Joined:
    Sep 13, 2017
    Messages:
    194
    Likes Received:
    31
    Gender:
    Male
    Occupation:
    Skirt Chaser
    Location:
    FSU (Former Soviet Union)
    I just went into my HT Access files and changed it to:

    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access plus 1 year"
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/gif "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/pdf "access plus 1 month"
    ExpiresByType text/x-javascript "access plus 1 month"
    ExpiresByType application/x-shockwave-flash "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 year"
    ExpiresDefault "access plus 2 days"
    </IfModule>
    ## EXPIRES CACHING ##


    And according to GT metrix I still have score of E, I didn't change anything, is there anything I can do fix this up.
     
  2. Nut-Nights

    Nut-Nights Jr. VIP Jr. VIP

    Joined:
    Jun 20, 2013
    Messages:
    7,847
    Likes Received:
    4,705
    Occupation:
    Plumber
    Location:
    Google News Domain ↓
    Home Page:
    Why dont you try plugin to speed up your site ? i am not technical guy but its easy to do things using plugins.
     
  3. HarishSEO

    HarishSEO Junior Member

    Joined:
    Feb 29, 2012
    Messages:
    128
    Likes Received:
    34
    There are two hard things in computer science: cache invalidation and naming things.

    I hope you know what you are doing.
     
  4. WPninja

    WPninja Junior Member

    Joined:
    Apr 25, 2017
    Messages:
    177
    Likes Received:
    32
    Gender:
    Male
    Occupation:
    Creative WP Front-end Expert
    Location:
    Coding-Jungle
    Does GTMetrix state E only for leverage cache or it's for overall rank?
     
    • Thanks Thanks x 1
  5. mexela

    mexela Junior Member

    Joined:
    Aug 13, 2014
    Messages:
    163
    Likes Received:
    67
    Location:
    where our clients need us
    use cloudflare
     
    • Thanks Thanks x 2
  6. SimpleSiteSolutions

    SimpleSiteSolutions Jr. VIP Jr. VIP

    Joined:
    Oct 2, 2009
    Messages:
    1,069
    Likes Received:
    1,789
    Occupation:
    Your next writer
    Location:
    Canada
    This
     
  7. El Magico

    El Magico Junior Member

    Joined:
    Sep 13, 2017
    Messages:
    194
    Likes Received:
    31
    Gender:
    Male
    Occupation:
    Skirt Chaser
    Location:
    FSU (Former Soviet Union)
  8. El Magico

    El Magico Junior Member

    Joined:
    Sep 13, 2017
    Messages:
    194
    Likes Received:
    31
    Gender:
    Male
    Occupation:
    Skirt Chaser
    Location:
    FSU (Former Soviet Union)
    I have Cloudflare any setting I should turn on?
     
  9. WPninja

    WPninja Junior Member

    Joined:
    Apr 25, 2017
    Messages:
    177
    Likes Received:
    32
    Gender:
    Male
    Occupation:
    Creative WP Front-end Expert
    Location:
    Coding-Jungle
    You can't control external sources' leverage cache time though they are hosted on their own server.

    For google analytics, remove all the tracking codes or plugins, and install this one - https://wordpress.org/plugins/host-analyticsjs-local/

    It'll fix analytics cache issues.

    Regarding image cache, try this on your htaccess replacing your's one -

    Code:
    # Leverage Browser Caching Starts here
    <IfModule mod_expires.c>
     ExpiresActive On
      ExpiresDefault "access plus 2592000 seconds"
      ExpiresByType image/x-icon "access plus 2592000 seconds"
      ExpiresByType image/jpeg "access plus 2592000 seconds"
      ExpiresByType image/png "access plus 2592000 seconds"
      ExpiresByType image/gif "access plus 2592000 seconds"
      ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
      ExpiresByType text/css "access plus 2592000 seconds"
      ExpiresByType text/javascript "access plus 2592000 seconds"
      ExpiresByType application/javascript "access plus 2592000 seconds"
      ExpiresByType application/x-javascript "access plus 2592000 seconds"
      ExpiresByType text/html "access plus 600 seconds"
      ExpiresByType application/xhtml+xml "access plus 600 seconds"
    </IfModule>
    # Leverage Browser Caching Ends here
    If the problem exists, then contact to your host provider, there might be some limitation on your server.
     
    • Thanks Thanks x 1
  10. El Magico

    El Magico Junior Member

    Joined:
    Sep 13, 2017
    Messages:
    194
    Likes Received:
    31
    Gender:
    Male
    Occupation:
    Skirt Chaser
    Location:
    FSU (Former Soviet Union)
    Tried it out got mild improvement, Thanks any tips for fixing Optimize the order of styles and scripts?
     
  11. VSpell

    VSpell Newbie

    Joined:
    Jul 22, 2016
    Messages:
    29
    Likes Received:
    8
    Gender:
    Male
    After many years of bitter experience trying to speed up my websites and using a number of high-powered hosting solutions, I ended up switching to GoDaddy. I know that they get a bad rap, but since I did it I've never had to worry about site speed, caching, or bad guys trying to take my websites down.
     
  12. Boriss

    Boriss Elite Member

    Joined:
    Nov 7, 2009
    Messages:
    1,747
    Likes Received:
    697
    Gender:
    Male
    Location:
    Inside a Monitor
    Home Page:
    I have this .htaccess on one of my sites:

    But, before trying this, make sure you backup your current .htaccess file.

    Code:
    ############## CACHING-GZIP ############
    
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault A2592000
    
    <FilesMatch "\.(txt|xml|js)$">
    ExpiresDefault A2592000
    </FilesMatch>
    
    <FilesMatch "\.(css)$">
    ExpiresDefault A2592000
    </FilesMatch>
    <FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac)$">
    ExpiresDefault A2592000
    </FilesMatch>
    
    <FilesMatch "\.(jpg|jpeg|png|gif|swf|webp)$">
    ExpiresDefault A2592000
    </FilesMatch>
    
    </IfModule>
    <IfModule mod_headers.c>
    <FilesMatch "\.(txt|xml|js)$">
    Header set Cache-Control "max-age=2592000"
    </FilesMatch>
    
    <FilesMatch "\.(css)$">
    Header set Cache-Control "max-age=2592000"
    </FilesMatch>
    
    <FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac)$">
    Header set Cache-Control "max-age=2592000"
    </FilesMatch>
    <FilesMatch "\.(jpg|jpeg|png|gif|swf|webp)$">
    Header set Cache-Control "max-age=2592000"
    </FilesMatch>
    </IfModule>
    
    <IfModule mod_deflate.c>
    <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>
    <IfModule mod_filter.c>
    AddOutputFilterByType DEFLATE "application/atom+xml" \
    "application/javascript" \
    "application/json" \
    "application/ld+json" \
    "application/manifest+json" \
    "application/rdf+xml" \
    "application/rss+xml" \
    "application/schema+json" \
    "application/vnd.geo+json" \
    "application/vnd.ms-fontobject" \
    "application/x-font-ttf" \
    "application/x-javascript" \
    "application/x-web-app-manifest+json" \
    "application/xhtml+xml" \
    "application/xml" \
    "font/eot" \
    "font/opentype" \
    "image/bmp" \
    "image/svg+xml" \
    "image/vnd.microsoft.icon" \
    "image/x-icon" \
    "text/cache-manifest" \
    "text/css" \
    "text/html" \
    "text/javascript" \
    "text/plain" \
    "text/vcard" \
    "text/vnd.rim.location.xloc" \
    "text/vtt" \
    "text/x-component" \
    "text/x-cross-domain-policy" \
    "text/xml"
    </IfModule>
    <IfModule mod_mime.c>
    AddEncoding gzip              svgz
    </IfModule>
    </IfModule>
    
     
  13. topakins

    topakins Regular Member

    Joined:
    Jan 24, 2014
    Messages:
    289
    Likes Received:
    113
    Gender:
    Male
    Location:
    Somewhere in Africa
    They say WP Rocket is an amazing plugin