Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #37594
| From | Arno Welzel <usenet@arnowelzel.de> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: image refresh |
| Date | 2019-10-21 16:34 +0200 |
| Message-ID | <h15u0gFmtmgU1@mid.individual.net> (permalink) |
| References | <7vCdnZ7_BaCawTDAnZ2dnUU7-T_NnZ2d@westnet.com.au> |
On 21.10.19 09:19, Andrew Poulos wrote: > I have an image that, when the page loads, loads a default image then > (based on user input) creates and loads a different image. The user can > keep entering new input and the image created changes accordingly but > the file name stays the same. > > Is the "only" way to refresh just the image to change the src by adding > a time stamp eg. src = imgUrl + "?t=" + timestamp; Another way is to add appropriate expire headers on the server (either an expiration date in the past or "Cache-control: max-age=0, must-revalidate"). If you can't change what the server sends, that you have indeed to use URL parameters. -- Arno Welzel https://arnowelzel.de
Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread
image refresh Andrew Poulos <ap_prog@hotmail.com> - 2019-10-21 18:19 +1100
Re: image refresh Andrew Poulos <ap_prog@hotmail.com> - 2019-10-21 19:38 +1100
Re: image refresh "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-10-21 12:06 +0200
Re: image refresh Arno Welzel <usenet@arnowelzel.de> - 2019-10-21 16:34 +0200
csiph-web