Django

Code

Ticket #6566 (closed: fixed)

Opened 10 months ago

Last modified 5 months ago

newforms-admin does not send all HTTP headers

Reported by: jarrow Assigned to: nobody
Milestone: 1.0 alpha Component: django.contrib.admin
Version: newforms-admin Keywords: nfa-blocker
Cc: Triage Stage: Accepted
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

When looking at the change list view for a model in Opera (9.23), change something, hit save. Click it again in the list and the old values are still there. Firefox (2.0.0.12) and IE6+7 don't cache the change form.

This may be Opera's problem, but I don't see any cache control headers beeing sent so maybe the default behaviour is just different?

Attachments

no-cache.diff (507 bytes) - added by jarrow on 03/30/08 13:53:34.
Patch that adds a no-cache header to admin/base.html, fixes problem on Opera 9.26 (Windows)

Change History

03/11/08 15:41:15 changed by jacob

  • status changed from new to closed.
  • needs_better_patch changed.
  • resolution set to worksforme.
  • needs_tests changed.
  • needs_docs changed.

I can't reproduce with Opera 9 on my mac. This probably means it's a weird upstream cache where you are.

03/30/08 13:45:43 changed by jarrow

I do not believe it's a cache somewhere between me and the server. But as long as nobody else can reproduce this I won't reopen. So could someone with Opera on Windows please try this?

Note that I go from the change view to the list (by hitting save), click the same entry again and Opera doesn't seem to reload the prepopulated form data. If I click 'Save and continue editing' it works fine.

IMHO it makes sense to prevent caching on the whole admin and it's just a tiny change to the base template :) (see patch).

03/30/08 13:53:34 changed by jarrow

  • attachment no-cache.diff added.

Patch that adds a no-cache header to admin/base.html, fixes problem on Opera 9.26 (Windows)

03/30/08 23:43:06 changed by ubernostrum

I also can't reproduce this, and at any rate all of the admin views apply the never_cache decorator, which sets the Expires and Cache-Control headers to force immediate expiration and forbid caching of the page. If your copy of Opera isn't respecting those (mine does), you've got bigger problems.

03/31/08 07:44:28 changed by jarrow

Thx for the response ubernostrum! Did you test on newforms-admin? Which version of Opera did you use? Which OS?

I tested the headers again with Firebug but I can see no Expires or Cache-Control headers. What I get is this:

Response Headers
Date	Mon, 31 Mar 2008 12:22:53 GMT
Server	Apache/2.2.3 (Debian) mod_python/3.2.10 Python/2.4.4 PHP/4.4.4-8+etch4
Vary	Cookie
Content-Type	text/html; charset=utf-8
Keep-Alive	timeout=15, max=100
Connection	Keep-Alive
Transfer-Encoding	chunked

So if you too tested on newforms-admin I will have to find out why the never_cache decorator doesn't work on my setup.

03/31/08 08:05:42 changed by jarrow

Ok, I just set up a test-project on the same machine with trunk, result:

Response Headers
Date	Mon, 31 Mar 2008 12:53:25 GMT
Server	WSGIServer/0.1 Python/2.4.4
Expires	Mon, 31 Mar 2008 12:53:25 GMT
Vary	Cookie
Last-Modified	Mon, 31 Mar 2008 12:53:25 GMT
Etag	2f62a785bb02ce2522f7e9efe4ec74c0
Cache-Control	max-age=0
Content-Type	text/html; charset=utf-8

That was the development server while my last post featured apache. So here ist the result from newforms-admin on the development server for comparison. They are both from the admin index page.

Response Headers
Date	Mon, 31 Mar 2008 12:37:54 GMT
Server	WSGIServer/0.1 Python/2.4.4
Vary	Cookie
Content-Type	text/html; charset=utf-8

And by the way: Django rocks :)

03/31/08 08:39:15 changed by jarrow

  • keywords set to nfa-blocker.
  • summary changed from Opera caches admin pages to newforms-admin does not send all HTTP headers.

04/01/08 19:23:34 changed by brosner

  • status changed from closed to reopened.
  • resolution deleted.
  • stage changed from Unreviewed to Accepted.

The newforms-admin views have not respected their trunk equivalent decorators, yet. Not sure if this is due to waiting for #6470. However, I was able to replicate the missing headers using Firefox.

06/16/08 10:48:48 changed by garcia_marc

  • milestone set to 1.0 alpha.

06/18/08 09:21:11 changed by duke@spacebox.net

Does this issue have any kind of priority? The admin interface is totally unusable in this condition. The pragma/no-cache meta tag has no effect in Firefox, Safari, Opera, or Internet Explorer as far as I can tell. I'm also having problems logging in - a message comes up saying I may have cookies disabled so it takes about 3 attempts before I can login, and new objects are still not listed; sometimes no message appears and I'm still not logged in. Logging out is also a problem - any cached page will still appear without having to log in again.

It seems I have to restart the server every time I add a new object just so it gets listed.

(Revision 7691 + pragma/no-cache)

06/24/08 15:35:15 changed by lukeplant

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [7737]) newforms-admin: Fixed #6566 - restored never_cache() decorator to admin views.


Add/Change #6566 (newforms-admin does not send all HTTP headers)




Change Properties
Action