Forum Moderators: open

Message Too Old, No Replies

Force IE to use pictures in cache?

         

HeLLsHInE

1:04 pm on Apr 26, 2006 (gmt 0)

10+ Year Member



Hello

I got a problem. I've made a custom webserver with omnis (some older OO language). I use AJAX on client side.
I'm building a Tree with javascript (i got icons for the plus/mins, the treeline, rootline) 6 pictures together.

now when i load the first 5 levels of my tree (around 600 times using those images) ie makes 600 requests, which is unaccpetable loading time.

how can i force ie to use the pictures in cache (ie will have the pictures after the first 6). Is there a way to force IE e.g with a tree not to load every little picture x 100 times?

i have the cache on automatic. even with option never it makes 600 servercalls.

regards
HeLlsHinE

encyclo

1:49 am on Apr 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld HeLLsHInE!

First thing to check is how the server is handling the image files, in particular whether the server is allowing caching by setting the Etag, taking into account an If-Modified-Since, etc. for the image files.

If you have Firefox, you can use the Live HTTP headers extension. You should see something like:

http://example.com/image.jpg 

GET /image.jpg HTTP/1.1

Host: example.com

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.13) Gecko/20060418 Firefox/1.0.8 (Ubuntu package 1.0.8)
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-ca,en;q=0.8,fr-ca;q=0.5,fr;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
If-Modified-Since: Wed, 24 Aug 2005 19:53:30 GMT
If-None-Match: "1cd9b-2c98-3ff1a44490280"
Cache-Control: max-age=0


HTTP/1.x 304 Not Modified
Date: Thu, 27 Apr 2006 01:43:12 GMT
Server: Apache/2.0.53 (Ubuntu) PHP/4.3.10-10ubuntu4.4
Connection: Keep-Alive
Keep-Alive: timeout=15, max=97
Etag: "1cd9b-2c98-3ff1a44490280"

The above was copied from a connection recorded by the Live HTTP headers extension for an image file served by my local test server. The first section is my browser's GET request, the second part the reply by Apache.

My concern is, with a custom web server, it may well not be built to be cache-friendly or cache-aware, which would explain why your image is repeatedly requested by the browser. You may be forced to use a separate image server running Apache (or similar cache-friendly web server software) in order for your menu to work correctly.

HeLLsHInE

9:32 am on Apr 28, 2006 (gmt 0)

10+ Year Member



hello

thanks for your answer, with firefox caching works, but as the most people still using IE, i need a way that it works with IE too.

those header entries don't work with IE :(