trafficserver-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reindl Harald <h.rei...@thelounge.net>
Subject Re: vary User-Agent storing only two versions
Date Tue, 24 Mar 2015 13:55:49 GMT


Am 24.03.2015 um 14:43 schrieb tomr:
> We’ve got a site we’re trying to get behind a bunch of ATS instances we’re running.
 The site serves differing content, at the same URL, to mobile UAs.  As there are only two
versions I’d like to only cache twice, rather than once per UA.  Is there a possibility
to do this with ATS?  I don’t want to simply Vary for all UAs, because the point of the
exercise is offloading traffic from the origin.
>
> If it can’t be achieved with ATS, I’m thinking of putting an httpd instance online
that could add a query string or a path in the URI, then using three regex_remap rules to
get the desired behaviour.  Maybe.  Open to suggestions!

you can't, but you can at least optimize the behavior for static files 
on the origin

# Properly handle requests behind proxies
<IfModule mod_headers.c>
  <FilesMatch "\.(php)$">
   Header append "Vary" "User-Agent"
  </FilesMatch>
  <FilesMatch 
"\.(gif|jpe?g|png|htm|html|xml|sgm|sgml|css|js|txt|htc|ico|flv|mp4|m4v|wmv|mov|mpg|ogv|webm|mp3|wav|ogg|oga|swf|doc|docx|xls|xlsx|ppt|pptx|pdf|eot|ttf|otf|woff)$">
   Header unset "Vary"
  </FilesMatch>
  <FilesMatch 
"\.(htm|html|xml|sgm|sgml|css|js|txt|htc|wav|doc|docx|xls|xlsx|ppt|pptx|pdf|eot|ttf|otf|woff)$">
   Header set "Vary" "Accept-Encoding"
  </FilesMatch>
</IfModule>


Mime
View raw message