Question

To display a dynamically loaded image in my webapp I'm using a BufferedDynamicImageResource. (It just loads the image from a backend server based on an database id.)

The URL of the image resource ends up as:

http://localhost:8080/wicket/page?17-IResourceListener-logotype
                                  ^^
                            sequence number

where the sequence number increases for each such image I generate.

The problem is that the URL is reused from execution to execution (the sequence number is reset to 0) so when I restart the server the browser does not fetch the newly generated images, but instead uses the cached versions (which were generated last execution of the webapp).

My Question: What is the best way to avoid this behavior? (If I could for instance add the database id of the image which is loaded to the URL, everything would work fine.)

Was it helpful?

Solution

The most common way to solve this would be to mount the resource as seen here. Using this approach, you could use the id as a parameter or add an (ignored) random parameter to prevent caching completely.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top