利用浏览器缓存

根据:http://code.google.com/speed/page-speed/docs/caching.html#LeverageBrowserCaching我应该使用浏览器缓存。但是,我不知道怎么做。 我只是在html部分添加某些标签吗?或者是我需要通过服务器发送给客户端的东西?与php标题有关吗?     
已邀请:
缓存由各种HTTP标头控制。您应该阅读Mark Nottingham的Web作者和网站管理员的缓存教程。您可以使用标头功能为从PHP输出的文档设置HTTP标头。     
您可以在.htaccess中执行类似的操作。
  ## 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 ##
    

要回复问题请先登录注册