On Jun 10, 2014, at 10:14 AM, geo...@free.fr wrote: > > On Jun 10, 2014, at 3:18 AM, geo...@free.fr wrote: > >>> - what is the best place to modify header for a group of document type like >>> images, remap.config (regex_map+header_rewrite) or cache.config ? >> >> Best place? On the origin for sure. If you for some reason can’t do that, >> header_rewrite ought to suffice for many (but not all) >rules. I’m pretty >> sure it can do regex matching on the path. > > I tried using ATS 4.1.2 but it doesn't work, maybe it's implemented into > later versions like 4.2. I am waiting for its availability in the ports tree > under FreeBSD. > >>> - is or will it possible to use header_rewrite plugin into cache.config to >>> modify header ? >> >> >> No, cache.config is orthoganol from header_rewrite. The former controls >> caching behavior, the latter modifies request and/or response >headers. > OK. > I want to keep objects like media (avi|jpg|mp3) for 7 days in cache while > telling the client "max-age=3d", keep office file for 3 days in cache while > telling the client 1 day (using ATS 4.1.2 TTL are in seconds)
I think you are overcomplicating things a bit though, use the protocol :). http://tools.ietf.org/html/rfc7234#section-5.2.2.9, e.g. Cache-Control: max-age=259200, s-maxage=604800 This would be so easy if you could just configure your origin servers to behave and send the above. Barring that, you could use header_rewrite to modify the origin server response to just that. I just cringe when people have to fight poorly configured origin servers, this stuff belongs on the origin, and not on the caches. Cheers, — Leif