in reply to Web server cache-ing?

the images, rather than being updated when I click the submit button in my form, are only being updated when I hit the refresh button

You haven't shown your form, in particular what action URI it submits to, and how you're handling the respective request on the server side. Also, under some circumstances, it could make a difference whether you use the HTTP method GET or POST.

First step would be to look in the webserver's access log to see if the request is actually coming in and what the server's HTTP response code is...

Update: or is your problem rather that you modify the images' content, but try to serve them under the same name/URI?  In that case, appending some dummy parameter to the image URIs, which changes from request to request (e.g. the current time)

$image_web_path.'imagefile6.gif?t='.time()

could get you around unwanted caching...

Replies are listed 'Best First'.
Re^2: Web server cache-ing?
by CountZero (Bishop) on May 22, 2008 at 14:31 UTC
    Making sure that the URL of the image changes is of course a good idea.

    However, as the content of the image changes, would it not be much more logical to change the filename, rather than adding a dummy parameter?

    Security wise it would also stop anyone from "stealing" images to which he should have no access, by simply directly requesting $image_web_path.'imagefile6.gif over and over again.Using a module such as Data::UUID can give you a unique identifier everytime you ask for one. If you clean the server-side "cache" of your files on a regular basis, it becomes almost impossible to guess the file name of any of the files in the cache, thus protecting the contents of these graphic files. The actual odds of guessing right would be 1 / (2^128) times the number of files (or better than 1 in 30 million300 billion billion billion billion times the number of files) in your cache.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re^2: Web server cache-ing?
by campbell (Beadle) on May 22, 2008 at 13:38 UTC
    Update: or is your problem that you modify the images' content, but try to serve them under the same name/URI? In that case, appending some dummy parameter to the image URIs, which changes from request to request (e.g. the current time)

    Yes, of course! That works nicely - Thank you.

    (campbell goes off to flagellate himself in the penance room)

      No reason to flagellate yourself :) — it's not your fault, but the browser's, applying half-legal heuristics to determine when to ask the server if the image has been updated... (performance being the motivation behind it, relying on the 'typical case').

        for the pleasure :)