Open Bug 1835100 Opened 2 years ago Updated 8 months ago

Cache-Control: no-cache with an ETag doesn't revalidate when used in an img element

Categories

(Core :: Graphics: ImageLib, defect)

Firefox 115
defect

Tracking

()

Tracking Status
firefox-esr102 --- affected
firefox-esr115 --- affected
firefox115 --- affected
firefox116 --- affected

People

(Reporter: Kai.Ruhnau, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.50

Steps to reproduce:

I have created a repository with the code: https://github.com/Tragetaschen/img-cache-control-issue and a running version of that code https://firefoximgcachecontrol.azurewebsites.net/

I have a backend server that on the same URL (/api) serves a GET request delivering an image with Cache-Control: no-cache and ETag headers and a PUT request that allows changing the delivered image on the backend.

I have web page, where I place an <img src="/api" /> to show the current image and some JavaScript to

  1. Toggle the src between the backend URL and a data-URL
  2. Send a PUT request to the backend to change the image.

Actual results:

After the PUT, changing the img src continues to show the same image contents. Looking at the Developer Tools' Network tab, it shows clearly that the image is "cached"

Expected results:

At least after the PUT, I expect the browser to revalidate the contents behind the URL using the provided ETag. This is the behavior described in RFC 7234: https://www.rfc-editor.org/rfc/rfc7234#section-4.4

I tested that expectation with Chromium-based browsers as well as Safari on iOS and they show the changed image contents when toggling the image after the PUT

The Bugbug bot thinks this bug should belong to the 'Core::Networking: Cache' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Networking: Cache
Product: Firefox → Core

Pretty sure that this is an issue with imgLoader

Component: Networking: Cache → Graphics: ImageLib

The severity field is not set for this bug.
:aosmond, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(aosmond)

When can I expect a substantial response here? It has been four weeks…

I've managed to reproduce this issue in Nightly 116.0a1 (2023-07-02) and Firefox 115.0 versions on Windows 10 x64.
Setting this as NEW.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(aosmond)
See Also: → 1980986
You need to log in before you can comment on or make changes to this bug.