views:

25

answers:

1

Hello friends..

I want to konw whether the browser caching of css and javascript is automatic with php or v hv to do it manually with code..

and wt are the advantages if i manually cache the css and js files to client browser.. using code..

??

If not cache wt will happened ??

A: 

By default a browser won't cache CSS or JS file served via PHP or any other dynamic server-side language. The HTTP response headers generated by PHP will declare the file as last updated at the current date. In order to have clients cache the response, you have to manually implement a conditional GET.

Here's a guide. It's for RSS, but applies for any HTTP request. http://fishbowl.pastiche.org/2002/10/21/http_conditional_get_for_rss_hackers/

greim