Try setting your mime type appropriately.
HttpResponse(mimetype="application/x-javascript")
Notice this in your view-generated-js response:
Content-Type: text/html; charset=utf-8
On Dec 5, 2007 3:08 PM, Matt <[EMAIL PROTECTED]> wrote:
>
> Alright... still haven't figured it out. The Vary: Cookie
Alright... still haven't figured it out. The Vary: Cookie header gets
added because I am using user authentication stuff and the view
depends on the user. But I still want the browser to cache the file. I
was thinking of using @cache_control(private=True, max_age=37000) in
order to deal with the
Alright... I think I might have tracked it down. I think it's an issue
with "Vary: Cookie" and it appears their is a fix for making this
header only show up when the request varies on the cookie.
http://code.djangoproject.com/ticket/3586
Haven't confirmed this yet, but seem like the issue.
Matt
Hi. I am trying to get a JS file cached by the browser using per-view
caching with @cache_page and/or @cache_control. But the file is not
getting cached as I would like.
I have the following scenario: A view generates a JavaScript file that
is unique for each user. However the JS file rarely chan
4 matches
Mail list logo