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) First I use cache.config url_regex=.* suffix=avi,mp3,jpg ttl-in-cache=7d url_regex=.* suffix=doc,xls,ppt ttl_in-cache=3d Then I want to use remap.config regex_map www.domain.com http://10.10.16.3 @plugin=header_rewrite.so @pparam=/usr/local/etc/trafficserver/header_rewrite_media.config And header_rewrite_media.config cond %{SEND_RESPONSE_HDR_HOOK} cond %{PATH} "/(avi|mp3|jpg)$/" rm-header Cache-Control add-header Cache-Control max-age=3d cond %{PATH} "/(doc|xls|ppt)$/" rm-header Cache-Control add-header Cache-Control max-age=1d I can't get it to work. Most of CDN offer this kind of granularity but I don't find how to it with ATS. Regards, Denis >Cheers, > >— Leif