They say it cannot be done, true?

N

News Reader

The default method of refreshing images is to
append a "?" plus a random value to its URL.
Then it should reload from the server without
being fetched from the cache.

Now, I have images to update which are
generated by the server and this server won't
accept any ?+numbers to be appended to
the URLs, because this would cause a distortion
of the submitted parameters. I was told that
there is no solution to this problem, except to
disable the browser's cache.

Theoretically I could put every image to an
iframe and use meta tags to have them
periodically refreshed. But I don't like this
approach, because this would make updating
all the required parameters dynamically a
headache.

Does anyone have a better idea?
 
R

Randell D.

News said:
The default method of refreshing images is to
append a "?" plus a random value to its URL.
Then it should reload from the server without
being fetched from the cache.

Now, I have images to update which are
generated by the server and this server won't
accept any ?+numbers to be appended to
the URLs, because this would cause a distortion
of the submitted parameters. I was told that
there is no solution to this problem, except to
disable the browser's cache.

Theoretically I could put every image to an
iframe and use meta tags to have them
periodically refreshed. But I don't like this
approach, because this would make updating
all the required parameters dynamically a
headache.

Does anyone have a better idea?


I'm still new to javascript but I think I'm getting to grips with it...
But if I had that problem, then my work around (which may not work in
100% all web browsers) would be to give all images a name... thus

<img src=/image.jpg id="imagename">

Then I would perform a javascript routine to replace the image using the
id tag as a reference using something like

document.getElementById('imagename').innerHTML="<img src=/image2.jpg>";

This routine could have an array containing image names which runs every
x number of seconds, or on a mouse over or whatever...

Would that help resolve your problem? Perhaps not - I'm thinking that
your image names seem never to change... dunno... perhaps there is
something there that will give you a work around, true?

randelld
 
N

News Reader

Thanks guys for your posts.

First of all - I guess I've found a solution:
The server appears to accept "&rand=" plus
a dummy parameter value. So I can go the
usual approach mutating this value. (So
Matthew's 1st post was on track.)

Unfortunately this does not really satisfy
my desire to use javascript to control
if an image can be fetched from the cache
or if it has to be reloaded from the server.

Nevertheless, just some short replies
to your posts:

Matthew: Extra path info wom't work,
but as mentioned "&rand=nnnn" is
accepted.

Micha & Randell D: The browser's cache
seems to be compared just to the url
which generates the server's response.
There is no image name involved.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top