Forums / General / The "last-modified" HTTP header

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>

eZ debug

Timing: Jan 18 2025 16:10:43
Script start
Timing: Jan 18 2025 16:10:43
Module start 'content'
Timing: Jan 18 2025 16:10:44
Module end 'content'
Timing: Jan 18 2025 16:10:44
Script end

Main resources:

Total runtime1.1956 sec
Peak memory usage4,096.0000 KB
Database Queries218

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 588.8359180.8438
Module start 'content' 0.00681.0873 769.6797742.2031
Module end 'content' 1.09410.1013 1,511.8828344.4766
Script end 1.1955  1,856.3594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.3303210.0002
Check MTime0.00140.1209210.0001
Mysql Total
Database connection0.00070.058410.0007
Mysqli_queries1.109692.80952180.0051
Looping result0.00210.17262160.0000
Template Total1.157396.820.5786
Template load0.00210.179220.0011
Template processing1.155196.616720.5776
Template load and register function0.00020.019310.0002
states
state_id_array0.00160.130610.0016
state_identifier_array0.00220.182520.0011
Override
Cache load0.00200.1639630.0000
Sytem overhead
Fetch class attribute can translate value0.00240.202160.0004
Fetch class attribute name0.00090.0769130.0001
XML
Image XML parsing0.00240.201660.0004
class_abstraction
Instantiating content class attribute0.00000.0023160.0000
General
dbfile0.00530.4434470.0001
String conversion0.00000.000730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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