eZ Community » Forums » General » The "last-modified" HTTP header
expandshrink

The "last-modified" HTTP header

The "last-modified" HTTP header

Monday 05 May 2003 1:56:51 pm - 9 replies

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.

Friday 09 May 2003 9: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

Friday 09 May 2003 11: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

Sunday 11 May 2003 9: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".

Thursday 03 July 2003 7:58:31 pm

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?

Wednesday 05 November 2003 6:37:53 pm

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

Modified on Friday 07 November 2003 5:21:25 pm by Alex Jones

Monday 10 November 2003 6:55:46 pm

Anyone?

Please?

Alex

Tuesday 11 November 2003 9: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

Tuesday 11 November 2003 3:19:53 pm

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

Friday 17 August 2012 5:50:02 pm

Hello,

I need to send an HTTP header 'last-modified' with the modification date of the current object in full view.

Is there a native function for this need ?

How could I add "http-equiv" meta in $site variable ?

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu