WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 6 years ago

#19444 closed defect (bug) (wontfix)

Widgets page stale when pressing the Back button

Reported by: willshouse Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Widgets Keywords: needs-patch
Focuses: Cc:

Description

For several versions of Wordpress (maybe all of them), I've noticed that the Widgets page can be loaded from cache:

http://img51.imageshack.us/img51/725/pictureen.png

I'm not sure why this is happening, when the page is first loaded headers are sent including no-cache, must revalidate, max-age=0, all of which seems to be done correctly:

http://img703.imageshack.us/img703/4526/screenshotwithshadow.png

However, if I load the widgets page, make a change to the order of the widgets, then navigate to another page, and then use the back arrow to go back to the widgets page, a cached version of the widgets page (pre-change) is loaded. This can be especially troublesome if you spend a lot of time making changes and adding and removing widgets, or widget content, then go back to the page and make another change before you realize that the cached page is loaded, because it will overwrite all the changes that you had just previously spent so much effort on.

One possible solution would be to load all the widgets with AJAX if javascript is available, or possibly re-check that the correct widgets are in place with AJAX after the page loads (and use Javascript to reload the page again if they are not). The latter method would also enable the page to be loaded using standard methods if Javascript was not enabled.

Change History (4)

#1 @scribu
10 years ago

  • Component changed from Cache to Widgets
  • Summary changed from Widgets page to Widgets page stale when pressing the Back button

This is because when you click "Back", no sane browser re-loads the page again. It just serves the page as it was last loaded, but without the DOM modifications made through JavaScript. So it's not a problem with our caching headers.

This is another reason why it's planned to make the widgets page act more like the menus page: you have to click Save for the changes to take effect, which would also cause a new page load.

#2 @azaozz
10 years ago

This is a problem for all screens that are updated with ajax and also for screens where the content can change after the user navigates away and before pressing the back button. Examples: the Categories, Tags, Comments, Dashboard screens. If comments are posted before the user presses the browser's back button, they won't show.

Adding a "Save" button to all these screens is not a good idea imho, not possible for the Dashboard anyways. Thinking we should explore other options. It seems there is a way to force the browser to reload the (already rendered) screen from the server when the Back button is pressed, at least for newer browsers.

#4 @chriscct7
6 years ago

  • Keywords needs-patch added
  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Closing as wontfix. Complete lack of interest on the ticket over the last 2 years. Feel free to reopen when more interest re-emerges (particularly if there's a patch)

Note: See TracTickets for help on using tickets.