Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2018-01-18 10:42:46

Xavez2
Member
Registered: 2017-09-19
Posts: 16

Latest Textpattern (~4.6) caching in admin side

Hi

I was just wondering if anyone else has noticed harder caching on the admin side of Textpattern? I’ve had the following happen to me a couple of times:

- Write piece of a post in draft
- Save it
- Close browser window
- Open browser again and go to posts overview
- Select the post I was working on
- A slightly older version than the latest one loads in the editor
- I start editing the text and hit save
- I get some vague error that “someone is already editing this post”
- I don’t really realise what is going on so I just hit save again
- It is now saved
- I realise that I lost an entire paragraph because I was editing some cached text in stead of the actual latest state the post was in

I can prevent this from happening by making sure that I alt+reload (Safari) when opening a post to make sure that I’m really editing the latest text. But it’s pretty annoying nonetheless. Wonder if anyone else has seen this?

Offline

#2 2018-01-18 11:53:36

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: Latest Textpattern (~4.6) caching in admin side

You could try Jukka’s rah_nochache. Also, if that helps, watch whether such caching happens on the front side of your website, too, according to my experience such behaviour is caused by the hoster.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#3 2018-01-18 12:27:41

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,081
Website

Re: Latest Textpattern (~4.6) caching in admin side

I haven’t experienced the specific issue you mention (editing a post), but I have noticed that the latest version of Safari (11.0.2 specifically) is more aggressive when it comes to caching (content, stylesheets, js). I would consider that a bug, but there could be something on my side though. (and something tells me that a 11.0.3 is around the corner…)

uli suggestion of the rah_nochache plugin might help.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#4 2018-01-18 12:38:51

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,273
Website GitHub

Re: Latest Textpattern (~4.6) caching in admin side

I’ve not witnessed this in exactly this form but I have had this happen, which is A Good Thing™:

  • Edit article.
  • Post changes.
  • Close browser.

… some time later …

  • Use another machine to tweak article.

… some time later …

  • Revisit first browser.
  • Article loads up with old content in the window because the browser restores the pane from before.
  • Make edits without realising they’re not the most recent.
  • Hit Save: warning pops up that “someone else” (me!) edited it in the meantime.
  • Phew! Bacon saved. If I’d committed the changes, I’d have lost the second set of edits I made. Thanks, warning!

So there are situations where this warning can be useful, but if there’s cacheing going on somewhere then it’s going to be pretty frustrating. Not sure why it would be doing that. There’s cacheing on the public side for sure (which can be turned off in Prefs), but I’m not aware of anything inside Textpattern itself that does admin-side cacheing.

Any other browsers you could test this on to see if phiw13 is right about Safari’s aggressive cache?

Last edited by Bloke (2018-01-18 12:40:10)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#5 2018-01-18 13:31:14

etc
Developer
Registered: 2010-11-11
Posts: 5,057
Website GitHub

Re: Latest Textpattern (~4.6) caching in admin side

Admin side does not seem to send Cache-Control header at all, nor Lastmod, so browsers are free to decide. In the run for the speed some might decide to use cache.

Offline

#6 2018-01-18 13:45:25

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,273
Website GitHub

Re: Latest Textpattern (~4.6) caching in admin side

etc wrote #308718:

Admin side does not seem to send Cache-Control header at all, nor Lastmod

Should we? For articles, comments, page, form, style content and prefs lists, it kinda makes sense to ensure every page is refreshed, doesn’t it? Plus any edit step.

For images, not sure. Leaving thumb cacheing to browsers might be useful for speed, but if it means that anyone replacing a thumbnail with a new one might see the old one when dropping back to the Image list panel, well, that’s undesirable.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#7 2018-01-18 14:12:02

etc
Developer
Registered: 2010-11-11
Posts: 5,057
Website GitHub

Re: Latest Textpattern (~4.6) caching in admin side

Bloke wrote #308720:

Should we?

Dunno, I’d say wait and see, since it worked fine before. If some browsers become too cache aggressive, they could break many sites and revert back.

Offline

#8 2018-01-18 14:38:17

towndock
Member
From: Oriental, NC USA
Registered: 2007-04-06
Posts: 329
Website

Re: Latest Textpattern (~4.6) caching in admin side

Bloke wrote #308720:

Should we?

Please no. Caching on the Admin side would be trouble. Much smarter to use bandwidth rather than not see updated work.

In response to XAavex2’s original question, I have not seen caching in Admin. I run dozens of sites on Textpattern.

Last edited by towndock (2018-01-18 14:40:20)

Offline

#9 2018-01-18 14:55:41

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,273
Website GitHub

Re: Latest Textpattern (~4.6) caching in admin side

towndock wrote #308723:

Please no. Caching on the Admin side would be trouble.

I meant should we employ Cache-control and/or Lastmod to force content to refresh every page load instead of leaving it to the whim of the browser ;-) Sorry if that wasn’t clear.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#10 2018-01-18 15:55:27

Xavez2
Member
Registered: 2017-09-19
Posts: 16

Re: Latest Textpattern (~4.6) caching in admin side

Bloke wrote #308724:

I meant should we employ Cache-control and/or Lastmod to force content to refresh every page load instead of leaving it to the whim of the browser ;-) Sorry if that wasn’t clear.

It might also be because of server-side caching settings, which textpattern probably doesn’t know about. That said: 4.6 is the first version where this issue popped up, and my server settings haven’t changed. It could also be because the latest Safari caches more aggressively. In any case I think it might be a good idea to set the cache headers explicitly for situations or contexts textpattern cannot possibly predict.

Edit: meanwhile I’ve installed the plugin; so far so good. Will keep you updated if this permanently fixes my problem.

Last edited by Xavez2 (2018-01-18 15:58:24)

Offline

#11 2018-01-19 03:45:33

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,081
Website

Re: Latest Textpattern (~4.6) caching in admin side

Bloke wrote #308724:

I meant should we employ Cache-control and/or Lastmod to force content to refresh every page load instead of leaving it to the whim of the browser

Hmm, that is something to think about of TXP.next? But that need to be handled with care so not to affect fetching of resources (low/slow bandwidth…).


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#12 2018-01-19 04:49:23

towndock
Member
From: Oriental, NC USA
Registered: 2007-04-06
Posts: 329
Website

Re: Latest Textpattern (~4.6) caching in admin side

Bloke wrote #308724:

I meant should we employ Cache-control and/or Lastmod to force content to refresh every page load instead of leaving it to the whim of the browser ;-) Sorry if that wasn’t clear.

In that case allow me to make a 180 :). Yes.

Offline

Board footer

Powered by FluxBB