Versioning and proxy cache

9 views
Skip to first unread message

Christian Zagrodnick

unread,
Apr 24, 2014, 3:32:33 AM4/24/14
to fans...@googlegroups.com
Hi,

in production deployments we usually have a frontend proxy cache to
cache static and semi-static resources. We've discovered some behaviour
which I want to discuss.

BLUF: New resources are served under the old url causing cache poisoning.

In the scenario there are at least 2 backend instances (A and B) being
updated and restarted after each other. So the have the states old and
new (A_old, A_new, …)

1. A_old is updated and becomes A_new
2. A_new serves a HTML page with versioned resource URLs.
3. The browser from step 1 loads the versioned resources from B_old
with the *new* URL. B_old serves the *old* resource with *new* URL.
4. The proxy stores an old resource with the new URL.

There are sevearal solutions to this:

1. clear the proxy cache after update
2. don't cache static resources
3. Don't serve resources with "wrong" urls.

Currently we're doing 1 or 2 and I'm courious what you think about 3. I
fear it might be a bit expensive to check the URL for each resource
request. So this might need to be a configuration option … 

Do you have any comments?

Best wishes,

Christian


--
Christian Zagrodnick · c...@gocept.com
gocept gmbh & co. kg · Forsterstraße 29 · 06112 Halle (Saale) · Germany
http://gocept.com · Tel +49 345 12298890
Python, Pyramid, Plone, Zope · consulting, development, hosting, operations


Reply all
Reply to author
Forward
0 new messages