Feeds and last modified / updated times

Discuss features as they are added to the new version. Give us your feedback. Don't post bug reports, feature requests, support questions or suggestions here.
Forum rules
Discuss features as they are added to the new version. Give us your feedback. Don't post bug reports, feature requests, support questions or suggestions here. Feature requests are closed.
Post Reply
Paul.J.Murphy
Registered User
Posts: 9
Joined: Mon Jun 16, 2008 4:49 am
Location: Edinburgh, Scotland, UK
Contact:

Feeds and last modified / updated times

Post by Paul.J.Murphy »

I've been having a play with 3.0.6-RC, and very glad to see feeds making it into the main distribution.

I have noticed one particular aspect of it which gives me some cause for thought. At present, the Last-Modified HTTP header and <updated> XML field both use time() which isn't exactly accurate or helpful. Here are the obvious spots which I'm thinking of, but there may be other spots in the code which could do with a tweak to make time/date more accurate:

Code: Select all

        'FEED_UPDATED'                  => $user->format_date(time(), $feed_date_format, true),
and

Code: Select all

        header("Last-Modified: " . gmdate('D, d M Y H:i:s', time()) . ' GMT');
Something like one of the following, depending on context, could be used instead of time(), and would be accurate nearly 100% of the time:

Code: Select all

SELECT MAX(forum_last_post_time) FROM phpbb_forums;

Code: Select all

SELECT MAX(topic_last_post_time) FROM phpbb_topics;

Code: Select all

SELECT forum_last_post_time FROM phpbb_forums WHERE forum_id=$forum_id;

Code: Select all

SELECT topic_last_post_time FROM phpbb_topics WHERE topic_id=$topic_id;
Also, adding something similar to the following would probably be appropriate with a more accurate Last-Modified:

Code: Select all

header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$config['feed_expires']) . ' GMT');
Another suggestion I have is to add $sort_days and $cache_time to the ACP page, as neither of those are really one-size fits all (although admittedly shouldn't be a significant issue for the huge sites to pop inside the code to tweak them).

Other than that, I reckon it looks pretty good.

User avatar
Acyd Burn
Posts: 1838
Joined: Tue Oct 08, 2002 5:18 pm
Location: Behind You
Contact:

Re: Feeds and last modified / updated times

Post by Acyd Burn »

Good suggestion. :) Can you add this to our bug tracker at the main site?

http://www.phpbb.com/bugs/phpbb3/

Image

Paul.J.Murphy
Registered User
Posts: 9
Joined: Mon Jun 16, 2008 4:49 am
Location: Edinburgh, Scotland, UK
Contact:

Re: Feeds and last modified / updated times

Post by Paul.J.Murphy »

Acyd Burn wrote:Good suggestion. :) Can you add this to our bug tracker at the main site?
'tis done. :-)
http://www.phpbb.com/bugs/phpbb3/ticket ... t_id=53305

Post Reply