Before describing the manipulation to be done to accelerate the speed of your site and reduce loading times, we want to clarify that some of these tips work well for sites that are not under WordPress.
Google said that the speed of page loading was a factor to consider in the SEO, then we should better optimize it.
Open to edit your .Htaccess file (take a backup first). For us, using online FTP works great to do the job. Add the following codes to your .Htaccess file before the starting of your WordPress rewrite rules:
< ifModule mod_gzip.c >
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
< /ifModule >< ifModule mod_expires.c >
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType text/html "access plus 1 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 216000 seconds"
ExpiresByType application/x-javascript "access plus 216000 seconds"
< /ifModule >< ifModule mod_headers.c >
<filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=2592000, public"
< /filesMatch>
<filesMatch "\.(css)$">
Header set Cache-Control "max-age=604800, public"
</filesMatch>
<filesMatch "\.(js)$">
Header set Cache-Control "max-age=216000, private"
</filesMatch>
<filesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=216000, public, must-revalidate"
</filesMatch>
<filesMatch "\.(html|htm|php)$">
Header set Cache-Control "max-age=1, private, must-revalidate"
</filesMatch>
< /ifModule >< ifModule mod_headers.c >
Header unset ETag
< /ifModule >
FileETag None
Update: Unfortunately, the if module syntax is not showing up properly. So, here is the file for you, just click to open it.
In case mess up, just delete the codes and save it or replace with your backup file.
You can read this interesting and useful topic to optimize the pageload speed from Yahoo. It really nicely written. You can implement PHP buffer flush to load very quickly. We used both of this methods to make this website load faster. For implementing PHP buffer flush; add this in your header . php ( just after closing of head tag) file via Theme editor:
<?php flush(); ?>
This will decrease the waiting time (particularly if the server is long away from the visitor) with a blank screen on browser waiting for full page to load.







[...] Flush the buffer early [...]