Jump to content


Photo
  • Please log in to reply
2 replies to this topic

#1 giteshss2

giteshss2

    Rank II Member

  • Members
  • PipPip
  • 98 posts
  • Gender:Male

Posted 18 January 2017 - 12:53 PM

Greetings!

 

Am a developer, new to the business.

 

while going across google page speed for the simplest site hosted by me, 

i came across some issues:

 

  • Should Fix: Eliminate render-blocking JavaScript and CSS in above-the-fold content
  • Consider Fixing: Leverage browser caching

 

i have googled the problem but was unable to find a quick and specific solution.

 

Can Someone Help?

 

 



#2 Krydos

Krydos

    Rank X Member

  • Root Admin
  • 18,415 posts
  • Gender:Male

Posted 18 January 2017 - 03:48 PM

Here's an example of browser caching that I use. Just create a .htaccess file in your web root with the contents

# Cache
ExpiresActive On
ExpiresDefault A0
 
# 1 YEAR - doesn't change often
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
  ExpiresDefault A31536000
</FilesMatch>
 
# 1 WEEK - possible to be changed, unlikely
<FilesMatch "\.(js|css|jpg|jpeg|png|gif|swf)$">
  ExpiresDefault A604800
</FilesMatch>
 
# 3 HOUR - core content, changes quickly
<FilesMatch "\.(txt|xml)$">
  ExpiresDefault A10800
</FilesMatch>
 
# 1 YEAR
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
  Header set Cache-Control "max-age=31536000, public"
</FilesMatch>
 
# 1 WEEK
<FilesMatch "\.(js|css|jpg|jpeg|png|gif|swf)$">
  Header set Cache-Control "max-age=604800, public"
</FilesMatch>
 
# 3 HOUR
<FilesMatch "\.(txt|xml)$">
  Header set Cache-Control "max-age=10800"
</FilesMatch>
 
# NEVER CACHE - notice the extra directives
<FilesMatch "\.(html|htm|php|cgi|pl)$">
  Header set Cache-Control "max-age=0, private, no-store, no-cache, must-revalidate"
</FilesMatch>
 
<FilesMatch ".(js|css)$">
  Header append Vary: Accept-Encoding
</FilesMatch>


Here's a good guide for getting the above the fold content to load faster on your page https://varvy.com/pa...r-blocking.html



#3 giteshss2

giteshss2

    Rank II Member

  • Members
  • PipPip
  • 98 posts
  • Gender:Male

Posted 19 January 2017 - 02:19 AM

Thanks a lot krydos.

That seems to be very helpful. Giving it a try.

Thank you once again.







Also tagged with one or more of these keywords: giteshss, pagespeed, render-blocking javascripts, render-blocking css, browser caching, heliohost

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users