The "last-modified" HTTP header

Author Message

Jan Egil Kristiansen

Monday 05 May 2003 4:56:51 am

I note that e.g. http://ez.no/ has a last-modified header that is always equal to the date header.

That may be technically correct, as the page is created dynamically.

But as a user (agent), I need to know when the content of the page was modified, i.e. when was the page logically modified? Is there any way eZ can keep track of the newest database change that affects the page content? (Or if not, using the last global DB update to set modified-date?)

Of course, with "expires: 1981", the modification date doesn't matter.

I also miss version info in "x-powered-by: eZ publish" - I do not know which version I'm talking about here.

Bård Farstad

Friday 09 May 2003 12:35:27 am

Currently there are no function which can return the last modification of a page. We can only do this for content objects. I.e. we can generate the modification header based on the last modification time of the article/product/forum, but other content included in e.g. the menues would then not be considered.

We have discussed this, but we don't have a solution, yet. Any input is appreciated.

eZ publish 3 does send the header:
X-Powered-By: eZ publish

--bård

Documentation: http://ez.no/doc

Paul Borgermans

Friday 09 May 2003 2:53:45 am

>Currently there are no function which can return the last
>modification of a page. We can only do this for content
>objects. I.e. we can generate the modification header based
>on the last modification time of the article/product/forum,
>but other content included in e.g. the menues would then not
>be considered.

>We have discussed this, but we don't have a solution, yet.
>Any input is appreciated.

setting the mofication header to the modification date of the content object is the most logical to me, maybe with an ini setting to switch from the current behaviour.

Paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Marco Zinn

Sunday 11 May 2003 12:50:35 pm

We have a site, which gets new content "only" every few hours.
Between this updates, the site content is static.
Will it help to set the last-modified to the last update of the complete database? Well, almost "complete": You'd need to ignore session data, as they will change a lot.
I don't know, if you can do that: Ask the database (or the DB handling functions in ezDB) "when was last update in content?"

How will that effect the log-in for users?
I mean: I frontpage of the site changes depending on user read rights. Plus, we have navigation elements, that show or hide depending on the user's user-group(s).
I'm talking about ezP2, but I think, ezP3 has the same "problems".

Marco
http://www.hyperroad-design.com

Jan Egil Kristiansen

Thursday 03 July 2003 10:58:31 am

Taking a time stamp from the main content of the page, ignoring menus etc., is not a good idea.

But using the modification time of the entire content database (while not perfect) will be an improvement compared to constant claim of freshness.

Simply removing the Last-modified header is probably better than filling it with disinformation?

Alex Jones

Wednesday 05 November 2003 9:37:53 am

How could I force eZ publish to present the content modified date in the Last-Modified header? I understand the implications, but this capability is important for us to put into place.

I have found the line in eZ's index.php which sets the Last-Modified date:
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . 'GMT' );

How do I change it?

Any help would be greatly appreciated!

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Alex Jones

Monday 10 November 2003 9:55:46 am

Anyone?

Please?

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Bård Farstad

Tuesday 11 November 2003 12:00:47 am

Alex, to get the modified header correctly you could send some header information in kernel/content/view.php. This would override the global header information.

You need to make sure that eZ publish stores the modification date to the cache file so you can fetch this from the cached files and use as header information.

Hope this helps.

--bård

Documentation: http://ez.no/doc

Alex Jones

Tuesday 11 November 2003 6:19:53 am

Thanks for the pointer Bård! I will see what I can do. If/When I figure this out I will post a write-up for others.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 05:12:25
Script start
Timing: Jan 18 2025 05:12:25
Module start 'layout'
Timing: Jan 18 2025 05:12:25
Module start 'content'
Timing: Jan 18 2025 05:12:25
Module end 'content'
Timing: Jan 18 2025 05:12:25
Script end

Main resources:

Total runtime0.6507 sec
Peak memory usage4,096.0000 KB
Database Queries81

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0082 589.0391152.6250
Module start 'layout' 0.00820.0040 741.664139.4453
Module start 'content' 0.01220.6372 781.1094737.1250
Module end 'content' 0.64940.0012 1,518.234420.1641
Script end 0.6506  1,538.3984 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.5546160.0002
Check MTime0.00140.2195160.0001
Mysql Total
Database connection0.00090.135710.0009
Mysqli_queries0.565086.8381810.0070
Looping result0.00080.1233790.0000
Template Total0.611794.020.3059
Template load0.00200.306920.0010
Template processing0.609793.706220.3049
Template load and register function0.00010.023010.0001
states
state_id_array0.00190.292010.0019
state_identifier_array0.00080.120520.0004
Override
Cache load0.00190.2862630.0000
Sytem overhead
Fetch class attribute can translate value0.00070.106750.0001
Fetch class attribute name0.00110.1687130.0001
XML
Image XML parsing0.00240.363350.0005
class_abstraction
Instantiating content class attribute0.00000.0046160.0000
General
dbfile0.00150.2315360.0000
String conversion0.00000.002640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 37
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs