How can I configure setting a Header in httpd.conf based on content type?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi
I'd like to try and configure the following outcomes in my httpd.conf:
a) for static images, stylesheets, javascript, Cache-Control:max-age
3600 and Expires: + 3600. This I can easily do by using the ExpiresByType
directive for these content types (text/css, application/x-javascript,
image/* etc)
b) for html, I want to set Cache-Control: no-cache, no-store (and probably
Pragma to no-cache or Expires to -1 to prevent HTTP 1.0 from caching). I'd
rather not use max-age=0 because that will download my pages to the user's
browser.
I can't see how to do b) i.e. define a different Header based on the
content-type which seems to be text/html. I've tried enclosing my Header set
command within a <FilesMatch "\.(htm|html)$"> directive, but this doesn't
seem to match my HTML.
Has anyone got any ideas please? Do I need to add a Directory of where my
application is? (I'm using a proxy server and my application server is on
another machine, so I don't know how easily I can do this, if needed).
thanks, Baljeet.
-- 
View this message in context: http://old.nabble.com/How-can-I-configure-setting-a-Header-in-httpd.conf-based-on-content-type--tp27850927p27850927.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux