Server's technical question: file's modification date?

Status
Not open for further replies.

LostHorizon

Member
Messages
43
Reaction score
2
Points
8
Hi,

Please correct me if I'm wrong: when a user visits a page on the web, he/she's making an HTTP request to the remote server that hosts the web page, the server then fetches the requested page and sends it back to the user's computer to display in the web browser.

Can anybody please explain to me in detail the process when the server's fetching the page (does it make a local copy of the requested page before sending it out over the Internet connection, or does it just access and transmit the page directly?).

The reason that I'm asking this because I've been with many web hosting companies in the past and even though they're using the same Apache server software, but when it comes to displaying the page's file last modification date, some of them display the current date (the date that the user accesses the page) which is INCORRECT (it broke my codes) instead of the ACTUAL date (the date that the page's owner uploaded it to the host server, or the date that he/she last modified it whichever date comes last).

Anyway, in my page, I'm using the standard JavaScript/JScript method "document.lastModified()" which returns the page's file last modification date since I don't want to "hard code" the date. X10Hosting server does display the page's file last modification date correctly (which I'm glad). This brings me to another question is that if there is some way, some settings to configure the server to display the page's ACTUAL modification date?

Looking forward to your explanation and answer,

Thanks a lot.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Do you have a page URL where it does not work?

Your Javascript reads the Last-Modified header from the server. Not sure what happens to that value if the server does not send that header (it is optional). It might default to today's date.
 

LostHorizon

Member
Messages
43
Reaction score
2
Points
8
Hi descalzo,

Thank you for getting back to me. If I'm not mistaken, what you meant by "Your Javascript reads the Last-Modified header from the server" is that when the server sends the requested page back to the user, it also sends an accompanied response header and that's where the JavaScript/JScript code "document.lastModified()" picks up the modification date (i.e., somewhere within that response header, there is a field that contains the page's file last modification date), is it right?

Anyway, here's the URL of one of my test pages where the code doesn't work:

http://losthorizon.freehostingnoads.net/

By the way, if what's you're saying is true, is there an easy way that I can verify this? How do I get the response header so I can have a look at its contents?

Thank you very much.
 

LostHorizon

Member
Messages
43
Reaction score
2
Points
8
Thanks descalzo,

You've been very helpful and prompt too (you really know your stuffs :)). I went to the URL that you've suggested and see what you meant by "Last-Modified" from some of the site's screen shots.

I'm going to close this thread now (i.e., if I can find the link to do it :)), and again thanks a lot. You really make my day.
 
Status
Not open for further replies.
Top