Help - Search - Members - Calendar
Full Version: SSI kills lastModified
Movable Type Community Forum > Additional Resources > Tips and Tricks
Muffinboy
Well, found the answer, so posting it here hopefully helps other people too:

My friendly webserver admin send me a link that explains different ways to timestamp your webpages. It also notes that using SSI is incompatible with Javascript methods of timestamping.

http://tech.irt.org/articles/js130/#2.1:

"Limitations  
Unfortunately, it seems that the JavaScript technique doesn't work if the file is already using SSIs (say for some other purpose). That is, the above technique will not work if the file is of the type *.shtml and includes

document.write(document.lastModified)"

Exactly why this is, it doesn't explain, but I'd hazard a guess and say that because you dynamically (well, sort of dynamically) bind different pieces of HTML together when you use SSI, the webserver doesn't compose the usual HTTP header it does for static html pages, so your webbrowser can't use the Javascript option to extract the document date from it.

Frank.
Muffinboy
I'm experimenting with SSI and I've noticed something weird.

In documents that are parsed by Apache for SSI directives (whether they contain any or not) the document.lastModified is set to 0 (zero).

Any javascript using document.lastModified will return either nonsensical dates or for instance 1970.

Anyone who knows how I can get pages SSI parsed _and_ get a normal return on document.lastModified???

TIA, Frank.

some updated info: using SSI to display the last modified date (#flastmod) works and outputs the correct date, it just seems that SSI parsed documents don't get a correct date set by the Apache webserver.

Anyone know if this is normal or if I should contact the server admin about a possible configuration error?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.