Discussion:
[chromium-discuss] Random behavior of browser
may schiller
2018-06-13 21:36:10 UTC
Permalink
I am facing a problem which involves fetching images, sending them to canvas, resizing them and sending them back to server.

At first I got a 'canvas tainted' error. I solved it by assigning 'crossorigin-anonymous' on my image. This solution was ok but I still got CORS error. It seems that since the browser fetches the cached image and that image doesn't carry a CORS assignment - the action will fail. My BIGGEST problem is that I cannot figure out the random behavior of the browser. When I try to reconstruct the scenario , meaning - fetching an image and assigning a crossorigin value, sometimes the image is coming back from server (s3) and sometimes from cache (this is when I get the CORS error).

I'm not looking for a solution - I know that assigning a random number to img src will force a server fetch.

I am looking for an explanation on the random behavior of the browser.
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
PhistucK
2018-06-14 05:56:14 UTC
Permalink
First, I would consider it a bug that the cache does not have this
information (unless some other website cached it before and the cached
response did not have those headers). crbug.com?
Second, I think you might be able to understand the reason for using/not
using cache if you keep chrome://net-internals open while your page makes
those requests.
It is very verbose, but it might help.

☆*PhistucK*
Post by may schiller
I am facing a problem which involves fetching images, sending them to
canvas, resizing them and sending them back to server.
At first I got a 'canvas tainted' error. I solved it by assigning
'crossorigin-anonymous' on my image. This solution was ok but I still got
CORS error. It seems that since the browser fetches the cached image and
that image doesn't carry a CORS assignment - the action will fail. My
BIGGEST problem is that I cannot figure out the random behavior of the
browser. When I try to reconstruct the scenario , meaning - fetching an
image and assigning a crossorigin value, sometimes the image is coming back
from server (s3) and sometimes from cache (this is when I get the CORS
error).
I'm not looking for a solution - I know that assigning a random number to
img src will force a server fetch.
I am looking for an explanation on the random behavior of the browser.
--
--
http://groups.google.com/a/chromium.org/group/chromium-discuss
---
You received this message because you are subscribed to the Google Groups
"Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
Loading...