+ Reply to Thread
Results 1 to 3 of 3

Thread: Force Image Caching

  1. #1
    learning_brain is offline x10 Sophmore learning_brain is an unknown quantity at this point
    Join Date
    Apr 2010
    Location
    UK, Midlands
    Posts
    170

    Force Image Caching

    I have an image preview page that dynamically shows the first 10 images from a database using a loop. The viewer can then pass/fail an image using form method.

    I have done 10, because I only use large images and I wanted to speed the process up. I assumed that if one image was loaded, it would cache it so that on submit, it would already be loaded and only load the next image (number 11).

    But.... it's always re-loading each image...

    I have looked at header controls and found plenty of reference to forcing of cache reload, but not force cache.

    I am forced to think this is browser specific, but each image is only 500kb-2MB and it still re-loads.

    Is this because they are hot-linked images?

    What gives?
    Last edited by learning_brain; 08-04-2010 at 08:13 AM.

  2. #2
    marshian's Avatar
    marshian is offline x10 Elder marshian is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Belgium
    Posts
    526

    Re: Force Image Caching

    You're right, as far as I can find in http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html , there is no way to actually force the client to cache anything. Caching is only ever allowed or prohibited, never required.

    It could very well be browser-specific that your browser always reloads all images. Section 14.9.4 of the document I've linked explains some of the mechanisms a client can use to force reloading the cache. However, each browser will have his own set of rules for that.

    All together, unless I'm mistaking there is no way to do that using only standard http caching mechanisms. You could however look into different possibilities. For example, a Java applet or Flash element could implement its own cache. Using Javascript and making your page dynamic would also be a possibility. There's no modern browser that's going to refresh the entire page if you add a node to the HTML tree.
    Real programmers don't document their code - if it was hard to write, it should be hard to understand.

  3. #3
    learning_brain is offline x10 Sophmore learning_brain is an unknown quantity at this point
    Join Date
    Apr 2010
    Location
    UK, Midlands
    Posts
    170

    Re: Force Image Caching

    Aha!! an answer... thank you.

    I like the javascript idea, although I have made some other amendments to supplement it.

    Now, every image, pending or otherwise gets a thumbnail generated automatically.

    The review page now loads multiple thumbnails, with a javascript hover script to load up the original if required... much like the index page. This allows me to fail (and delete unecessary thumb) or pass lots of images quickly.

    My problem ATM is that the crawler is pulling in so many images, I don't have the time to keep up with it. This will certainly help.

    Thanks again

+ Reply to Thread

Similar Threads

  1. Caching in SMF
    By smartflight in forum Free Hosting
    Replies: 3
    Last Post: 03-16-2010, 11:40 AM
  2. PHP caching
    By zordon19 in forum Programming Help
    Replies: 0
    Last Post: 12-17-2009, 07:08 AM
  3. ads free and force ads
    By ata.online in forum Off Topic
    Replies: 14
    Last Post: 12-06-2009, 05:04 PM
  4. About web caching
    By radofeya in forum Programming Help
    Replies: 6
    Last Post: 07-17-2008, 12:47 PM
  5. G-Force Design
    By g-force in forum Ads & Offers
    Replies: 3
    Last Post: 06-05-2008, 06:01 PM

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