You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by tomr <to...@equalit.ie> on 2015/03/24 14:43:05 UTC
vary User-Agent storing only two versions
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!
Thanks in advance,
Tom
--
You can always deny what you said, but you can never deny what you wrote
- Anon
Re: vary User-Agent storing only two versions
Posted by Alan Carroll <so...@yahoo-inc.com>.
Yes, I've worked with a client who does effectively the same thing. You want to look at
HTTP Alternate Selection — Apache Traffic Server 5.3.0 documentation
which lets a plugin control the set of alternates and their selection for a single URL.
| |
| | | | | |
| HTTP Alternate Selection — Apache Traffic Server 5.3.0 documentationHTTP Alternate Selection The HTTP alternate selection functions provide a mechanism for hookinginto Traffic Server’s alternate selection mechanism and augmenting itwith additional information. |
| |
| View on docs.trafficserver.apache.org | Preview by Yahoo |
| |
| |
Re: vary User-Agent storing only two versions
Posted by Reindl Harald <h....@thelounge.net>.
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>