Welcome! Log In Create A New Profile

Advanced

Re: Tricky Caching reverse Proxy - different User agents to be watched

Ryan Malayter
May 10, 2010 09:16AM
On Mon, May 10, 2010 at 2:41 AM, musa <nginx-forum@nginx.us> wrote:
> Well, in this case (realy small page, short caching time) it doesnt matter when it caches for each user-agent.

The user-agent string contains a lot more than just the browser
version, unfortunately. It can also includes the versions of various
browser plug-ins, add-ons, etc., which means you are caching a
different version of each page for IE8 users with one version of .NET
or another.

For example, here's a full user-agent string pulled from our logs:
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0;
SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729;
Media Center PC 6.0; InfoPath.2)

To eliminate unnecessary requests to the back-end as well as
duplicated cache entries, it might be best to use the nginx map module
to "normalize" the User-Agent to just a few values:
http://wiki.nginx.org/NginxHttpMapModule

For example (syntax not tested, just a guess based on documentation):

map $http_user_agent $shortua {
default anybrowser;
*iPhone* iPhone;
*Blackberry* bb;
*IEMobile* winmoble;
"*Windows Phone*" winmobile;
}

proxy_cache_key "$scheme$proxy_host$uri$is_args$args $shortua";

--
RPM

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Tricky Caching reverse Proxy - different User agents to be watched

musa May 07, 2010 10:18AM

Re: Tricky Caching reverse Proxy - different User agents to be watched

Igor Sysoev May 07, 2010 05:24PM

Re: Tricky Caching reverse Proxy - different User agents to be watched

musa May 10, 2010 03:41AM

Re: Tricky Caching reverse Proxy - different User agents to be watched

Ryan Malayter May 10, 2010 09:16AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 226
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready