views:

169

answers:

0

Background

I am working on a web application built on Django. I use the auth context_processor, which causes a Vary: Cookie header on each response (See http://code.djangoproject.com/ticket/6552)

I return images through a Django view to check user permissions, etc. These images should be cached on the browser for an hour. The images are displayed in the browser directly in HTML and also within a Flash SWF.

Problem using Firefox

When I link to one of these images from within HTML, they get cached correctly. When reloading the page, the images are not reloaded.

When I request an image through Flash, the image is requested from the server every time.

If I remove the Vary: Cookie header at the server, caching works in Flash as well.

Notes

In Internet Explorer everything works, since IE does not support the Vary header very well and Django just removes it for images sent to IE.

I would like to keep the header, since there are situations where different users could get different images through the same URL. I could introduce the user name in the URL to work around this, but I would still have to suppress the Vary header.

Has anybody else experienced this or knows what the difference is between a request coming from Firefox directly or from a Flash SWF to cause this caching behavior?

Thank you!