Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#49 2022-05-26 10:27:48

mikulas
Member
From: Czech republic
Registered: 2012-03-15
Posts: 38

Re: Outdated page after article publication

<txp:php>
dmp(get_pref(‘lastmod’));
dmp(get_lastmod());
</txp:php>

Output is:

2022-05-26 12:25:02
1653560702

Offline

#50 2022-05-26 10:45:40

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

Re: Outdated page after article publication

Looks ok atm. The last-modified header is generated via something like

dmp(safe_strftime('rfc822', min(get_lastmod(), time()), 1));

Is it failing here?

Offline

#51 2022-05-26 11:07:49

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

Re: Outdated page after article publication

phiw13 wrote #333439:

The live server gives something odd:

2022-04-20 11:28:02...

This was for a draft article, fwiw. A live article returns some correct values.


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

Offline

#52 2022-05-26 11:12:13

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

Re: Outdated page after article publication

phiw13 wrote #333442:

This was for a draft article, fwiw. A live article returns some correct values.

Yes, saving a draft article shouldn’t modify the lastmod stamp.

Offline

#53 2022-05-26 11:15:55

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

Re: Outdated page after article publication

etc wrote #333443:

Yes, saving a draft article shouldn’t modify the lastmod stamp.

That is what I figured out, but what is odd is that the article I used for testing was created today.

etc wrote #333441:

Looks ok atm. The last-modified header is generated via something like

dmp(safe_strftime('rfc822', min(get_lastmod(), time()), 1));...

this tells me: Thu, 26 May 22 11:14:39 +0000 which is correct


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

Offline

#54 2022-05-26 11:30:51

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

Re: Outdated page after article publication

phiw13 wrote #333444:

That is what I figured out, but what is odd is that the article I used for testing was created today.

If it was draft-born, the lastmod stamp does not change. Or do you mean its <txp:modified /> is wrong?

this tells me: Thu, 26 May 22 11:14:39 +0000 which is correct

Interesting. If also the final step returns something meaningful (in live mode), then we should look on the side of plugins/server misconfiguration:

dmp(handle_lastmod(null, false));

Offline

#55 2022-05-27 01:31:33

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

Re: Outdated page after article publication

etc wrote #333445:

If it was draft-born, the lastmod stamp does not change. Or do you mean its <txp:modified /> is wrong?

No – the output of <txp:modified /> is correct.

Interesting. If also the final step returns something meaningful (in live mode), then we should look on the side of plugins/server misconfiguration:

dmp(handle_lastmod(null, false));...

That outputs the correct time and HTTP status on my side (live server):

array (
  0 => '200',
  1 => 'Fri, 27 May 22 01:05:09 +0000',
)

–^–

To be clear: I see the same incorrect HTTP header output: Last-Modified: Thu, 01 Jan 1970 00:00:00 GMT as others upthread, but I have no problems (with a stale page) otherwise. Updating an article is immediately reflected on the public side both at the individual article page level or in any article list that includes the article. This as seen from 3 different networks / locations / devices. The Textpattern generated date stamps are correct.

When I compare the HTTP headers for a Textpattern generated page with a static HTML page, the only relevant difference is the presence of the Last-Modified header for the TXP page.


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

Offline

#56 2022-05-27 09:07:34

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

Re: Outdated page after article publication

Weird. At this point php tries to set header("Last-Modified: Fri, 27 May 22 01:05:09 +0000"), but Thu, 01 Jan 1970 00:00:00 GMT is sent instead.

I guess RFC 822 is a wrong format here. MDN preconizes four-digit year and GMT indicator. What we used to call rfc822 before txp 4.8.8 was actually %a, %d %b %Y %H:%M:%S GMT, not the true RFC 822 as now.

Thanks for the report, mea culpa, as usual. Will fix.

Offline

#57 2022-06-25 07:42:50

mikulas
Member
From: Czech republic
Registered: 2012-03-15
Posts: 38

Re: Outdated page after article publication

I guess RFC 822 is a wrong format here. MDN preconizes four-digit year and GMT indicator. What we used to call rfc822 before txp 4.8.8 was actually %a, %d %b %Y %H:%M:%S GMT, not the true RFC 822 as now.

I apologize for the late response.
I changed the txplib_misc.php file in TXP 4.8.8 installations according to this file from development version 4.9 and everything works fine.
Thanks for the help.

Offline

Board footer

Powered by FluxBB