Leverage browser caching

oshirowanen picture oshirowanen · Apr 8, 2011 · Viewed 16.5k times · Source

According to: http://code.google.com/speed/page-speed/docs/caching.html#LeverageBrowserCaching I should be using browser caching. However, I don't know how.

Do I simply add certain tags into the html section? Or is thing something I need to send via to server to the client? something to do with php headers?

Answer

Quentin picture Quentin · Apr 8, 2011

Caching is controlled via a variety of HTTP headers. You should read Mark Nottingham's Caching Tutorial for Web Authors and Webmasters. You can set HTTP headers for documents outputted from PHP using the header function.