Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-03-06 20:38:50

Anpan
New Member
Registered: 2011-03-06
Posts: 3

Textpattern doesn't update pages automatically

I have the following problem:

If I create a new article or make any other change to the content, TP does not update the site by simply following a link. Instead, to see the new content, you always have to force-reload.
This is especially annyoing if I try to change preferences of TP. I have to force-reload 10 to 20 times before it actually accepts the change.
The problem exists with all browsers.
Now I suspect this has something to do with caching. I turned off the “Send last-modified header” option but it causes no change. When I asked on my hosters support forum, I was pointed to the http header, which contained:

Cache-Control: max-age=86400

I was told to set max-age to 0, which I tried quick&dirty by including php code into the page, but instead of re-setting the value to 0, it just outputs:

Cache-Control: max-age=0, max-age=86400

with no change to the problem.

How can I get textpattern to send max-age=0 in the header or otherwise fix this problem?

Last edited by Anpan (2011-03-06 20:40:25)

Offline

#2 2011-03-07 00:13:56

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Textpattern doesn't update pages automatically

Anpan wrote:

Cache-Control: max-age=86400

Textpattern doesn’t set such header. Your server is for reasons or another, configured to output such header. Your host should be able to help you, but I guess not then according their reply.

I was told to set max-age to 0, which I tried quick&dirty by including php code into the page, but instead of re-setting the value to 0, it just outputs:

By output you mean that it sends both headers? What you tried was similiar to this:

<txp:php>
	header('Cache-Control: max-age=0');
</txp:php>

At the top of your page template?

If that just added more junk to the header, and you don’t have access to server configuration, then you should contact your host. They should be able to help. If it’s self configurable host, or you have access to server configuration, the header is probably set somewhere in the Apache (or other sever) configs or parent .htaccess files.

Last edited by Gocom (2011-03-07 00:21:32)

Offline

#3 2011-03-07 00:26:24

Anpan
New Member
Registered: 2011-03-06
Posts: 3

Re: Textpattern doesn't update pages automatically

Yes, that was exactly what I did. It then sent max-age=0 like I wanted to, but right after that, it sends max-age=86400.

Offline

#4 2011-03-07 22:09:20

Anpan
New Member
Registered: 2011-03-06
Posts: 3

Re: Textpattern doesn't update pages automatically

I solved this myself now. If anyone runs into the same Problem, here is what I did:
To get rid of the caching problem without being able to change any server settings, you can paste the following code into the files index.php and /textpattern/index.php as the first two lines of php code:
header("Cache-Control: no-cache, must-revalidate"); header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");

This completely fixed the issue for me.

Offline

Board footer

Powered by FluxBB