cancel
Showing results for 
Search instead for 
Did you mean: 
Go to solution
Highlighted

Leverage Browser Caching

While I am enjoying the Managed WordPress Hosting at GoDaddy, my clients' sites have been getting poor pagespeed reports. One of the most usual culprits is "Leverage Browser Caching." 

 

Some quick research says that the issue is server-side and there is some code I could add to the .htaccess files.... But, because this is Managed WordPress Hosting, I would expect the host to be on top of it for me....

 

Has anyone else encountered this? What are you doing to address this issue?

 

Thanks

 

17 REPLIES 17
New

Re: Leverage Browser Caching

Yes I am having the exact same issue. It shows when you use Google's Pagespeed Tools Insights.

Re: Leverage Browser Caching

Yeah I'm currently trying to speed up my site performance too! The BEST cache plugins out there are unavailable for some reason......... Seems a little strange! 

 

If anyone finds the answer let me know! 

New

Re: Leverage Browser Caching

I'm having the same issue.

I've researched this and narrowed it down to some settings that Godaddy has in place. I've talked with Godaddy (at least the first front line rep that answered my call) and the rep assures me everything is working at Godaddy. He says it must be my content, NOT. He tried blaming one of my plugin providers because they store the files (that won't cache on the browser side) in a folder named "cache". The plugin provider could just as easily have named the folder "purple" or better yet, "Godaddy". I explained that if I turned the plugin off all my javascript files would appear as needing to take advantage of "leverage browser caching" (I tried it). At least with the plugin activated there are only two javascript files that are not being cached on the browser side.

I think the problem is that when anyone at Godaddy hears the word "cache" they have an automatic script to follow and they don't hear anything after that. 

I found a blog that tries to address the issue: http://cactusthemes.com/blog/setting-leverage-browser-caching-godaddy-hosting-doesnt-work/. I tried the recommendations in the blog. It may have worked when the blog was published but it doesn't work now, at least not for me. 

My options with a Managed Wordpress site at Godaddy would seem to be very limited.

 

New

Re: Leverage Browser Caching

I am experiencing this overall, even with other CMS (not Managed WordPress). Additionally, most of the traffic seems to be coming from the server itself... One website was also blacklisted by Spamhaus. I suspect there is an issue somewhere. I will be contacting tech support, since it is not my actual client email sending anything.

Re: Leverage Browser Caching

Browser Caching is accomplished in the .htaccess file. Below is an example of what we use on our websites but none of them are WordPress and you may need to adjust some of the parameters to suit your needs. 

 

<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType text/css "access plus 7 days"
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType text/javascript "access plus 14 days"
ExpiresByType application/x-javascript "access plus 14 days"
ExpiresByType image/ico "access plus 14 days"
ExpiresByType image/jpg "access plus 7 days"
ExpiresByType image/jpeg "access plus 14 days"
ExpiresByType image/gif "access plus 14 days"
ExpiresByType image/png "access plus 14 days"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType text/html "access plus 1 hour"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/rss+xml "access plus 1 hour"
ExpiresByType application/atom+xml "access plus 1 hour"
</IfModule>

 

 

Internet Marketing Firm 100% Veteran Owned and Staffed.
All members are Active Duty or Honorably Discharged Veterans of the United States or Canadian Military.
New

Re: Leverage Browser Caching

Kudos to Godaddy and the supervisor I spoke with, Zack. Short version is, the problem is solved. I don't know if it's solved for everyone but it's solved for me.

Thanks Zack. Thanks Godaddy.

Re: Leverage Browser Caching

Care to share with the rest of the users?

Re: Leverage Browser Caching

Dear Dougca & Go Daddy, 

 

Please can you share your magical solution with us too!!! I cannot find any step by step instructions for how to deploy browser caching. Was the fix you talked about a global fix for all Go Daddy customers or is this something we need to manually deploy?

 

Happy either way, just need to know the answer! 

 

Thanks

Re: Leverage Browser Caching

Hi Doudca,

Please share how its done, i am very annoyed with this issue. no one seems to know how to fix it.

Vas

Re: Leverage Browser Caching

I've been wrestling with the Google caching as indicated from the Page Speed Insight Results as well, which got me here to this forum.

 

With what I know, we each have the ability to edit our .htaccess file. (Always Backup FIRST!)  It's a very powerful document. So be careful or consult Support first with questions, which is what I plan to do.

 

I found TWO options for configuring our browser caching with in the .htaccess file on this page:

https://varvy.com/pagespeed/leverage-browser-caching.html

The example outlined by Serendipity above appears similar the OPTION ONE outlined on the above page. I may go with that first.

 

Here are the Two options from above page:

 

Option One

-----------------------------------------------------------

## 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 ##

 

----------------------------------------------

OPTION 2

----------------------------------------------

# 1 Month for most static assets
<filesMatch ".(css|jpg|jpeg|png|gif|js|ico)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>

-----------------------------------------------

Option TWO was referred as "Cache-Control" and "allows us to have a bit more control of our browser caching and many people find it easier to use once setup."

 

Perhaps someone here can point us all to a resource to help us edit our .htaccess files with "typical" or "suggested/recommended" parameters.

 

I did have an experience with our GoDaddy hosted site, getting hacked. Someone edited our .htaccess file and also uploaded a few nefarious pages and folders. GoDaddy Support did help me resolve that issue.

 

My understanding is the .htaccess file allows us each to modify how our site behaves in the wild when it is hosted in a shared hosting environment provided by GoDaddy and others.

 

Some folks have "typical" needs, for instance I just have one small business with a site here. Other folks may have private or membership sites hosted here and access to those sites can be configured and access limited to people with the proper credentials within the .htaccess file.

 

This is my simple understanding of the .htaccess and browser cache issues. If I have this wrong, will someone with deeper understanding help us out here and correct me.

 

Eskimo Tom

Yupik Studios

 

 

Solution

Re: Leverage Browser Caching

Just finished with GoDaddy Support on a two issues, one being the Google PageSpeed Insights Browser Cache concern. RESULT: Our site leaped up significantly in speed test results. Now at 96/100 on desktop and 79/100 on mobile.

 

Here is what GoDaddy HOSTING Support added to my .htaccess file:

 


<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>

<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On
# Default directive
ExpiresDefault "access plus 1 month"
# My favicon
ExpiresByType image/x-icon "access plus 1 year"
# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 month"
# Javascript
ExpiresByType application/javascript "access plus 1 year"
</IfModule>

---------------------

The above code was "given" to me, I simply asked HOSTING Support to put in what ever was suggested or recommended for our simple business site. Your site requirements may differ from mine. Hosting Support also cured our SSL connection. The page redirect for the SSL is likewise handled in the .htaccess file. I didn't include that portion of the code/text above, your circumstances may be different than mine. 

 

Regarding GoDaddy Support on this issue, it helped me to talk to someone in Hosting Support. The first level of GoDaddy support told me GoDaddy can't help when it comes to the content on your site's directory (which is where the .htaccess file resides. Initial level support staff will instead recommend you hire one of their outside contractors.

 

Good Luck!

 

Eskimo Tom

Yupik Studios

New

Re: Leverage Browser Caching

For Wordpress, some "cache" plugins getting along better with the host than others. Per this link - https://www.udemy.com/make-your-wordpress-sites-fastest-in-world/ - I've had the best luck with WP Smu**bleep**, WP SuperCache, WP Performance Score Booster, & WP Optimize. Just double check to make sure they are not on GoDaddy's blacklist.

Rob S.

www.BTWSB.net

Rob S. - www.BTWSB.net
New

Re: Leverage Browser Caching

Ummm..... Doudca called GoDaddy tech support to get them to do it. How is that done?

 

Serendipity posted a great option to modify the ht.access file, which you would find by going into cpanel and the file manager of your website. Back it up first, and then change or add the items he shows in the post above to get the site to allow browser caching of heavy items like images. If you mess it up, you can use the backup copy to restore the original and try again. Or just call tech support. Which ever you prefer.

New

Re: Leverage Browser Caching

Thanks for the reference to security re the ht.access file. Its more of a problem when you have multiple users who can access cpanel or the website file system. Not so much of a problem as long as users don't have those options. Most CMS give you the ability to control who can edit items, and not give them access to the file system directly.

 

For those who wish to edit the ht.access file via cpanel file manager, consult Support on the proper permissions so you don't inadvertently change them and compromise your website.

New

Re: Leverage Browser Caching

GoDaddy has black listed wordpress cache plugins.  If you want to make the changes you have to manually do them yourself.

This might be helpful:

 

  1. Go into FTP files and enter .HTacces file.
  2. Download current files for backup.
  3. Change the leverage caching time to minimum of 7 days.  Ideally a year

## 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 ##

  1. Add Gzip Compressions

<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>

  1. Specify a Vary:  Accept-Encoding Header

<IfModule mod_headers.c>
          <FilesMatch ".(js|css|xml|gz|html)$">
             Header append Vary: Accept-Encoding
          </FilesMatch>
</IfModule>

 

  1. Minifying files:  Remove all the whitespaces between code.  Attached image with example.
  2. Fix Render Blocking.  Avoid having JavaScript in the body of the coding.  Move JavaScript code to the bottom of the files
  3. Optimize images on website by doing compressions
  4. Minify CSS code and Javascript, and HTML
New

Re: Leverage Browser Caching

how can i estimate the Cache time as i am working on education blog such as reetresult dot co .in as i need 1 sec process as information updatde after 30 min later so how repeated user can check latest update if my caching time was long help me

Re: Leverage Browser Caching

godaddy 100%  Leverage Browser Caching solve

 

 

 

https://www.youtube.com/watch?v=hHc8MGmBUJQ