根据http://code.google.com/speed/page-speed/docs/caching.html#LeverageBrowserCaching,我应该使用浏览器缓存技术,但是我不知道如何操作。
我只需在html文件的头部添加特定标签吗?还是需要通过服务器将其发送给客户端?这涉及到PHP头文件吗?
我只需在html文件的头部添加特定标签吗?还是需要通过服务器将其发送给客户端?这涉及到PHP头文件吗?
## EXPIRES CACHING ##
<IfModule mod_expires>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES CACHING ##