Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #37594

Re: image refresh

Path csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Arno Welzel <usenet@arnowelzel.de>
Newsgroups comp.lang.javascript
Subject Re: image refresh
Date Mon, 21 Oct 2019 16:34:56 +0200
Lines 22
Message-ID <h15u0gFmtmgU1@mid.individual.net> (permalink)
References <7vCdnZ7_BaCawTDAnZ2dnUU7-T_NnZ2d@westnet.com.au>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 7bit
X-Trace individual.net vrNLU73LklT1Cjr2PA01kgA6lmYvRXbbfLUIOWs/7hEKgwxyx4
Cancel-Lock sha1:14EXeFRTOTg+UHAoGH5q/kEUSD0=
In-Reply-To <7vCdnZ7_BaCawTDAnZ2dnUU7-T_NnZ2d@westnet.com.au>
Content-Language en-US
Xref csiph.com comp.lang.javascript:37594

Show key headers only | View raw


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


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