Tuesday, March 17, 2009

browser caching

I have been struggling to get a solution to cache some of the files which are dynamically generated by PHP sitting on Apache server. A bit of investigation on HTTP Request/Response header revealed that "Last-Modified" Response header is set by the web server for static contents only like *.css/*.js, images and *.htm and not for dynamically generated content by *.aspx,*.jsp or *.php. This has been the main cause of such dymanically generated content not being cached by the browser.

A solution proposed by most of articles on web is to configure the web server to support "If Modified Since" request header. 

No comments: