Closed Thread
Results 1 to 5 of 5

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

  1. #1
    LostHorizon's Avatar
    LostHorizon is offline x10Hosting Member LostHorizon is an unknown quantity at this point
    Join Date
    Dec 2010
    Posts
    35

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

    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.

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,633

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

    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.
    Nothing is always absolutely so.

  3. #3
    LostHorizon's Avatar
    LostHorizon is offline x10Hosting Member LostHorizon is an unknown quantity at this point
    Join Date
    Dec 2010
    Posts
    35

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

    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.

  4. #4
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,633

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

    http://livehttpheaders.mozdev.org/

    with FireFox will let you see the request and response headers.

    The URL you posted does not send the Last-Modified header.
    Nothing is always absolutely so.

  5. #5
    LostHorizon's Avatar
    LostHorizon is offline x10Hosting Member LostHorizon is an unknown quantity at this point
    Join Date
    Dec 2010
    Posts
    35

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

    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.

Closed Thread

Similar Threads

  1. Server's Down!
    By Derek in forum Free Hosting
    Replies: 1
    Last Post: 07-18-2010, 04:27 PM
  2. PHP technical question
    By idlehands in forum Free Hosting
    Replies: 5
    Last Post: 12-11-2007, 04:25 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers