I am testing the performance of adding the crossorigin attribute to images.
It seems that there are different observable CORS image request behaviors in Chrome and Firefox, also differences on Windows and Linux.
I normally use Chrome on Linux, and as can be observed on an example page where the images are served from a correctly configured CORS proxy, there are no indications in devtools that the OPTIONS
method is being used. However, the requests look like CORS requests as they include the Origin header.
I have noticed a difference in the request headers if the server does not support the OPTIONS
method, here for example, which leads me to suspect that the browser does do a preflight, but it may not be logged in Chrome or Firefox devtools.
Strangely, Chrome DevTools on Windows logs the warning "Provisional headers are shown" for the same example, but also does not indicate that OPTIONS
requests are used.
One other question, is there a negative impact on performance if an OPTIONS
response includes a body? For images, it seems advisable that the OPTIONS
response should have a Content-Length
of 0.