I am just trying speed up my site after changing the protocol to https. I do notice that the time for waiting is pretty much.
![](https://www.manongdao.com/static/images/pcload.jpg)
As you can see the waiting time is almost 1.3s which is not good. It must be 500ms. What must be done to improve the speed of the site? Time To First Byte is very slow.
One way to improve the time to first bite is to enable caching. You can do this by pasting the following code at the end of your .htaccess file:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css "access plus 10 days"
ExpiresByType text/html "access plus 2 days"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType application/x-icon "access plus 1 year"
</IfModule>
This will speed up the speed of your website because the browser downloads the content once, and then does not download it again every time the page is visited. Specifying this yourself stops the browser from guessing how long to cache the file.
This code tells the browser to cache CSS for 10 days, HTML for 2 days, Images for 1 month, and so on. You can always change the values if you have different needs, but I have found this combination helpful for me. I hope that this helps!
If you want to optimize your website speed, I advise you to:
- think of avoiding multi-image sliders;
- make code minification;
- reduce the number of redirects;
- optimize images;
- improve website navigation.