Tricky Caching reverse Proxy - different User agents to be watched

musa nginx-forum at
Fri May 7 18:18:00 MSD 2010

Hello all

i hope somebody can help. didnt find any usefull post nor webside which could help.

short backend story: there is a web application which generates sites, different sites for different clients (ipod, nokia phones, normal browser etc). its an old application running on windows, with really poor performance. 

anyway, i had the idea to use the nginx in frontend as reverse proxy with caching, to speed up the site.. and it works perfect.(caching time only 10min, but enough to take load off the backend). the problem is:

- when the first visitor is a normal browser, the generated page will be the version for browser -> looks bad on the iphone/nokia phone
- when the first visitor is iphone.. it looks bad on everything else.

so ... is it possible.. to cache each version of the response based on the http-agent? and to deliver when the agents xyz matchs the cached version?

or i am asking for to much?

the websites are really small, so if a iphone has 10 different User-Agent variables (language etc in it) it doesnt matter, it can easy save the side 10x.

my english isnt best.. if its not clear what i mean.. please say so.. will try it again :)

any help/tricks/hints would help


Posted at Nginx Forum:,83848,83848#msg-83848

More information about the nginx mailing list