Opened 7 years ago

Closed 7 years ago

Last modified 3 years ago

#6566 closed (fixed)

newforms-admin does not send all HTTP headers

Reported by: jarrow Owned by: nobody
Component: contrib.admin Version: newforms-admin
Severity: Keywords: nfa-blocker
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 (1)

no-cache.diff (507 bytes) - added by jarrow 7 years ago.
Patch that adds a no-cache header to admin/base.html, fixes problem on Opera 9.26 (Windows)

Download all attachments as: .zip

Change History (12)

comment:1 Changed 7 years ago by jacob

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to worksforme
  • Status changed from new to closed

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

comment:2 Changed 7 years ago 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).

Changed 7 years ago by jarrow

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

comment:3 Changed 7 years ago 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.

comment:4 Changed 7 years ago 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.

comment:5 Changed 7 years ago 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 :)

comment:6 Changed 7 years ago by jarrow

  • Keywords nfa-blocker added
  • Summary changed from Opera caches admin pages to newforms-admin does not send all HTTP headers

comment:7 Changed 7 years ago by brosner

  • Resolution worksforme deleted
  • Status changed from closed to reopened
  • Triage 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.

comment:8 Changed 7 years ago by garcia_marc

  • milestone set to 1.0 alpha

comment:9 Changed 7 years ago by duke@…

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)

comment:10 Changed 7 years ago by lukeplant

  • Resolution set to fixed
  • Status changed from reopened to closed

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

comment:11 Changed 3 years ago by jacob

  • milestone 1.0 alpha deleted

Milestone 1.0 alpha deleted

Note: See TracTickets for help on using tickets.
Back to Top