Specifying 'Expires' header for JS file

  • Thread starter Thread starter VP
  • Start date Start date
V

VP

I would like to specify 'Expires' header for a js file. Can you please let
me know where & how to specify that.

Thanks.
 
try comp.lang.javascript
the javascript experts hang out there.

tim
 
to control .js (or any file) headers in .net, just changing the mapping in
iis to map *.js to the asp.net, then you can just add server code to set the
expires header to what you want.

-- bruce (sqlwork.com)
 
VP said:
I would like to specify 'Expires' header for a js file. Can you
please let me know where & how to specify that.

Thanks.

You can do this using the IIS admin plugin in MMC. I can't provide you
the exact button names to click since I'm running a German WinXP, but
it should work like this:

1. Put your JS file(s) in a separate subfolder within your web
application

2. In the treeview in the IIS MMC plugin, choose Properties from this
subdirectory's context menu

3. Select the HTTP headers tab

4. Under "User-defined headers", add Cache-Control: no-cache or
whatever caching header you like to use

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top