If an img element is added to the DOM with its `crossOrigin` property set to "anonymous", after its `src` property is set, Firefox will always make a network request to the image even if it is cacheable. See the simplified test case that is attached. Steps to reproduce: 1. Open the attached test case. 2. Click on the "toggle image" button. 3. See that the image takes a while to load. This is expected. 4. Click the "toggle image" to remove the image. 5. Click the "toggle image" button again. 6. See that the image take a while to load again, even though it should be cached. The test case loads an image from a server that intentionally responds slowly (with a 0.5s delay), to demonstrate the issue. This issue does not occur if the `crossOrigin` property is set before the `src` property. Chrome does not re-request the image with the same test case either way.
Bug 1760532 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
If an img element is added to the DOM with its `crossOrigin` property set to "anonymous", after its `src` property is set, Firefox will always make a network request to the image even if it is cacheable. See the simplified test case that is attached. Steps to reproduce: 1. Open the attached test case. 1. Refresh the page with `Ctrl+F5`, to ensure your cache is cleared. 2. Click on the "toggle image" button. 3. See that the image takes a while to load. This is expected. 4. Click the "toggle image" to remove the image. 5. Click the "toggle image" button again. 6. See that the image take a while to load again, even though it should be cached. The test case loads an image from a server that intentionally responds slowly (with a 0.5s delay), to demonstrate the issue. This issue does not occur if the `crossOrigin` property is set before the `src` property. Chrome does not re-request the image with the same test case either way.
If an img element is added to the DOM with its `crossOrigin` property set to "anonymous", after its `src` property is set, Firefox will always make a network request to the image even if it is cacheable. See the simplified test case that is attached. Steps to reproduce: 1. Open the attached test case. 1. Refresh the page with `Ctrl+F5` or `Ctrl+Shift+R`, to ensure your cache is cleared. 2. Click on the "toggle image" button. 3. See that the image takes a while to load. This is expected. 4. Click the "toggle image" to remove the image. 5. Click the "toggle image" button again. 6. See that the image take a while to load again, even though it should be cached. The test case loads an image from a server that intentionally responds slowly (with a 0.5s delay), to demonstrate the issue. This issue does not occur if the `crossOrigin` property is set before the `src` property. Chrome does not re-request the image with the same test case either way.
If an img element is added to the DOM with its `crossOrigin` property set to "anonymous", after its `src` property is set, Firefox will always make a network request to the image even if it is cacheable. See the simplified test case that is attached. Steps to reproduce: 1. Open the attached test case. 1. Refresh the page with `Ctrl+F5` or `Ctrl+Shift+R`, to ensure your cache is cleared. 2. Click on the "toggle image" button. 3. See that the image takes a while to load. This is expected. 4. Click the "toggle image" to remove the image. 5. Click the "toggle image" button again. 6. See that the image takes a while to load again, even though it should be cached. The test case loads an image from a server that intentionally responds slowly (with a 0.5s delay), to demonstrate the issue. This issue does not occur if the `crossOrigin` property is set before the `src` property. Chrome does not re-request the image with the same test case either way.