Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
395 views
in Technique[技术] by (71.8m points)

javascript - JS / HTML-当其源URL更改为同一img时,是否会缓存img?(JS/HTML - Is an img cached when its source URL changes for the same img?)

Using an img tag with a URL as the source will normally cache the image so it doesn't have to be reloaded.

(使用带有URL的img标签作为源通常会缓存图像,因此不必重新加载图像。)

What however happens when the src URL to the image changes but still references the same image?

(但是,当图像的src URL更改但仍引用同一图像时,会发生什么?)

Will the browser still use the cached version or will it fetch the new image everytime the URL changes?

(浏览器仍会使用缓存版本还是会在URL每次更改时获取新图像?)

Background of my question: I'm saving my images on an AWS s3 bucket and I use presigned URLs to reference an image.

(问题背景:我将图像保存在AWS s3存储桶中,并使用预先签名的URL来引用图像。)

Those URLs are generated on the fly and change constantly.

(这些URL是动态生成的,并且会不断变化。)

  ask by phoebus translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...