Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Oct 2002
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question 304 Server Code Question

    I am trying to take as much action as I can to reduce bandwidth and want to check something with people that know.

    Firstly, if a visitor request a file and they receive the code 304 (not modified) does that mean that they view a cached version? As such is it safe to assume that when they receive this code no bandwidth is used for this request?

    Secondly, I also understand that you are able to place requests somewhere (dont know where or how) to server telling them that they can cache the page and for how long. In particular, as the images that I use on my site are never edited, i would love to allow caching of all images for the longest time possible. eg. never expire

    Any help would be really cool!!
    Last edited by BusterLee; 11-23-2002 at 12:45 AM.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    NL
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts
    304 means there's a copy of the page in the browser's cache. The browser will ask the server if it has been modified since the last visit. If not, the server responds with a 304. That means, no bandwidth is used and the browser uses the cached page.
    I don't know if it's the same for proxy servers.
    Two interesting links: http://www.ircache.net/cgi-bin/cacheability.py
    and: http://www.mnot.net/cache_docs/

  • #3
    New Coder
    Join Date
    Oct 2002
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Mcookie.

    Just got some code from one of the sites and added it to .htaccess and subsequently used the validator link.

    Everything seems to be working as I wished and caching instructions/headers seem to be being sent okay!!

    Only question I do have is in relation to when the expiry date is set from? For instance the code below is what I added:-

    ExpiresActive On
    ExpiresByType image/gif A15552000
    ExpiresByType image/jpg A15552000
    ExpiresByType image/jpeg A15552000
    ExpiresByType text/html M300000

    Does the expiry time relate to the a: after modification date b: since cached or c: after browser/visitor last accessed page. I am under the impresion that it will infact expire on the "cache" after the specified time and should the file be requested again it will obtain a new copy, with the same header... thus going around in a loop and only refreshing when the previous header expires.

    I know this may sound a silly question however although I have read the literature you kindly directed me to, some of it does seem to go in circles for those of us that are a bit......... challenged!!

    Oh... thanks again for your previous help......... i have not doubt it will already help me out big time!!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •