SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    Confirmed Halfwit
    Join Date
    Oct 1999
    Location
    Vancouver, BC, Canada
    Posts
    983
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My client has designed a very graphic intensive (read: +130kb) page for their site template. Besides having to use frames, I'm trying to identify any other issues.

    One question I have: Typically, once the initial page loads, the graphics will remain in cache, right? So when other pages load, the browser will retrieve the stored graphic, and not go to the server all over again.. is that right? Does this scenario change if the user has set their browser in any way? (ie: check for new page at every visit, etc..)

    Thanks.
    - A simple online WYSIWYG editor for HTML code snippets.
    - Managed Web Hosting - $3.95/month (resellers welcome)
    - Why pay more? $8.95 domains & $9.95 SSL certificates!

  2. #2
    Irritability Defined
    Join Date
    Jul 2000
    Location
    80,000 feet below the surface
    Posts
    1,442
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by hstraf
    One question I have: Typically, once the initial page loads, the graphics will remain in cache, right?
    That is correct.

    So when other pages load, the browser will retrieve the stored graphic, and not go to the server all over again.. is that right?
    That is correct, as long as the way you reference to the image is the same on the other pages. What I mean by this is that the HTML code <img src="/images/picture.jpg"> remains the same on each and every other page.

    So if you have one page with <img src="picture.jpg"> and another page which has <img src="images/picture.jpg"> and yet another page which has <img src="/images/picture.jpg">, then the image will be loaded three times direct from the server, not the cache because each image has been referenced differently.

    Does this scenario change if the user has set their browser in any way? (ie: check for new page at every visit, etc..)
    It partly depends on whether you're going through a proxy or not. With some proxies you will get the same page as you visited 2 weeks ago, and you would have to click 'Shift-Refresh/Reload' to get the newest version of the page. With other proxies the latest version is always cached in your ISP's proxy, so it pays to experiment.

    And yes, it also depends on your browser's settings.... If you have "check for new page at every visit" then the browser will go direct to the server every time.
    My 2 Cents (or is that 2.2 Cents including GST?)

  3. #3
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That was a brilliant reply BC. Didn't knew about the proxy thing
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  4. #4
    Irritability Defined
    Join Date
    Jul 2000
    Location
    80,000 feet below the surface
    Posts
    1,442
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by lynlimz
    That was a brilliant reply BC. Didn't knew about the proxy thing
    The joys of working as a sysadmin
    My 2 Cents (or is that 2.2 Cents including GST?)

  5. #5
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Also, it depends on whether the server is sending out validators with the image...

    It the server sends out an Expires: or Cache-Control: line in the header, it tells the proxy or browser cache exactly how long the cached image is valid.

    Most modern browsers will, if they received no validator, keep the image in the cache for one browser session only. [note: this applies to IE even when you have it set to NEVER]

    Here's a handy tool to see what headers your server is sending out with the image. Put the IMAGE's url.

    http://www.delorie.com/web/headers.html
    Last edited by mmj; Apr 27, 2001 at 04:06.
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog Twitter Contact me
    Neon Javascript Framework Jokes Android stuff

  6. #6
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice resource mmj.
    Ha! It would do good for me to have some server administration I guess....=)
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  7. #7
    Don't eat yellow snow spaceman's Avatar
    Join Date
    Mar 2001
    Location
    Melbourne, Australia
    Posts
    1,039
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by mmj
    Also, it depends on whether the server is sending out validators with the image...

    It the server sends out an Expires: or Cache-Control: line in the header, it tells the proxy or browser cache exactly how long the cached image is valid.

    Most modern browsers will, if they received no validator, keep the image in the cache for one browser session only. [note: this applies to IE even when you have it set to NEVER]

    Here's a handy tool to see what headers your server is sending out with the image. Put the IMAGE's url.

    http://www.delorie.com/web/headers.html
    Hi mmj,

    Do you know a reliable way for browsers NOT to cache images? I'm using an image upload routine from a form (with help from PHP), but when the upload completes, the old image is displayed instead of the one I just replaced it with - until I click refresh/reload.

    I thought that these good old meta tags should work:

    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="-1">

    I've even put them in the header AND footer of my HTML page as recommended here:
    http://htmlgoodies.earthweb.com/beyond/nocache.html

    ...but still my old image insists on being displayed until I click refresh. Any suggestions?

    Thanks.


Bookmarks

Posting Permissions

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