Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Steps Improve Your Google PageSpeed Insight Score

DZone's Guide to

Steps Improve Your Google PageSpeed Insight Score

We know that slow websites equal lost revenue. Here are some ways you can increase your PageSpeed Insight score for peak performance.

· Performance Zone ·
Free Resource

Sensu is an open source monitoring event pipeline. Try it today.

.Page speed is a very important factor for every website. No one wants to wait too long for loading a website; everyone wants a speed! 

If your website is not speedy, then visitors will move to other websites. Your competitor will win that customer! So, take a page speed as a serious factor and start work on it.

Here Are the Steps to Improve Page Speed:

Try to implement these on your website and you will surely get a drastic improvement in page speed of your website. Be sure to note the current page speed score of the website before implementing these steps so that you can compare it.

1) Add the Following Code to Your .htaccess File (It's a Code for Apache htaccess):

  • Code for adding expire headers (a solution for leverage browser caching)
# Add Expire headers
<IfModule mod_expires.c>
<Filesmatch "\.(jpg|jpeg|png|gif|js|css|swf|ico|woff|mp3)$">
    ExpiresActive on
    ExpiresDefault "access plus 30 days"
</Filesmatch>
</IfModule>


  • Code for compression using deflate mode
# BEGIN DEFLATE COMPRESSION
<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
</IfModule>
# END DEFLATE COMPRESSION


2) Image Compression

If you are developing a new website, then compress images before uploading into the website. If you are optimizing your website, then check your website on Google PageSpeed Insights and you will get a list of images which are needed to be compressed. 

Image title


Compress those images and upload them again.

You can use online image compressors for image compression. Keep in mind that we have to optimize image size without losing quality. Some of the best image compressors are:

If you don't want to optimize manually and you are having WordPress website then, you can use Tiny PNG WordPress Plugin. It will compress all of your website images automatically. 

3) HTML, JS, and CSS Minifying 

Adding deflate module in .htaccess file will solve all major minification problems, but if it's still showing in PageSpeed Insights' analysis, then you can manually compress those files with following tools:

If you are using WordPress then you can use Autoptimize, W3 Total Cache or WP Fastest Cache.

4) Reduce HTTP Requests

With optimal coding, a developer can reduce https requests. When you a hire back-end developer, instruct him/her that you want an optimized code for your website because the fewer the HTTP requests, the faster the website!

5) Server Response Time

Actually, server response time is not in our hands but in the hosting service's, which is providing high response time.

Conclusion

Have you completed all 5 steps? If yes, then now check your score on PageSpeed insight. You will surely notice a significant increase in the performance of your page speed!

Sensu: workflow automation for monitoring. Learn more—download the whitepaper.

Topics:
pagespeed ,pagespeed insights ,page speed optimization ,performance ,site speed ,speed analysis

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}