如果您的网站加载缓慢,那么您的网站访问者会感到沮丧,那么您需要改进网站的页面加载时间。在今天的帖子中,我将分享简单而简单的方式减少页面加载时间。
浏览器缓存的好处1)减少页面加载次数以重复访问者。
2)利益成本比率将会很高。
每次访问任何网站时,浏览器会下载所有包含所有html,css,javascript和图像文件的web文件,以显示网页。
浏览到您网站的根目录并打开.htaccess文件,现在复制下面的代码并粘贴到文件的末尾并保存。以下代码将改进您的网站缓存,这将提高您的网站速度。
## expires caching ##
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"
## expires caching ##