Forum Moderators: phranque

Message Too Old, No Replies

Last Modified in Website

Last Modified in Website design

         

Web design uk

9:35 am on Apr 26, 2006 (gmt 0)

10+ Year Member



Hello these eveyone,

THis is my first post ever, and I have heard a lot of good things about webmaster forum so I am hoping to become a regular contributer and full member.

Now to start me off I am afraid I actually have a question. Currently I am having a little bit of trouble with header response codes. Specifically I am having an issues with LAst Modified Header.

Now my website is dynamically created using PHP and at the moment at the beginning of every web page it calls the Last-Modified(time(blabla)) header funtion and takes the server date / time.

While this seems okay at first, I have considered that this is probably a bad thing for Google as this takes up more crawling time.

Now being a good citizen in the web world I am wondering what I should do from both an internet marketing point of view and also an etical point of view. Should I...

1) Update the last modified header dynamically somehow? and if so how. THis way the last modified will actually say when the file actually was last modified or
2) Use the 304 header to say not modified or
3) Keep it as it is so that google thinks the page is always modified. But I think this is bad becuase google is not stupid enough to think oh this file was modified right now at the time I'm crawling it. Even though I suppose technically it is as I have a clock on teh site :)

I personally think number 1) but am concerned how I will do this on a large dynamic site.

Many thanks and look forward to replys.

Allan Stewart
<snip>

[edited by: trillianjedi at 9:37 am (utc) on April 26, 2006]
[edit reason] No SIGS or promo's please... [/edit]

henry0

11:22 am on Apr 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Allan and Welcome to WebmasterWorld

This Post should be in the PHP forum

Here is an example, using OOP
The idea is to have a little tiny text file: modified.txt, that is reached anytime the page where the modifier script is set.
Although the same principle could be applied with modified DB content instead of the text file.
<<<
<?
// the template
<div class="footer">
{FOOTER}
</div>

// the page with content and modified content
$footer = "Last modified " . (date("l, F j, Y", filemtime("modified.txt")));
$page->SetParameter("FOOTER", $footer);

// the modifier script
<? // Post "Last modified" message
$txt="../modified.txt";
$fp = fopen("$txt", "r+");
if($fp)
{
fseek($fp, 1);

$byte = fwrite($fp,1);

}
else
{
// email, error etc...
}
?>

Web design uk

3:58 pm on Apr 26, 2006 (gmt 0)

10+ Year Member



I tried this but it didn't work.

said that I have a call to an unfdefinated function or something such as.

henry0

5:42 pm on Apr 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Of course! You do not have the corresponding function
that is the engine of the script
The example was not supposed to work out of the box; you mentioned PHP so I thought that you were a PHP coder and I did provide a few guidelines.
Are you familiar with OOP, function and class?

Further ask trillianjedi to move the post to PHP forum