HTTP Header to cache .xml & .xsl files

  • Thread starter Thread starter Rahul Agarwal
  • Start date Start date
R

Rahul Agarwal

Hi

We use few .xml and .xsl files in our web application and we found that
these files even though fairly static gets downloaded to the client's
machine everytime the page is refreshed.

What should be the http header or what attributes in http header should be
added to avoid downloading of these files everytime on user's machine.

Please help
Rahul
 
Rahul said:
Hi

We use few .xml and .xsl files in our web application and we found
that these files even though fairly static gets downloaded to the
client's machine everytime the page is refreshed.

What should be the http header or what attributes in http header
should be added to avoid downloading of these files everytime on
user's machine.

That depends on how often these files change and if it's desirable to allow
public caches (as opposed to private caches) to store the data.

Cache-Control: public, max-age=86400

would allow any cache to store them and consider cached copies fresh for 24
hours.

Cheers,
 
Back
Top