jeudi 14 septembre 2017

Super slow preflight OPTIONS in Chrome only

I've been struggling recently with a super-weird problem only happening in Chrome: as my API (NodeJS) is on a different subdomain, I need to use CORS to reach it from my front-end (EmberJS).

It's working pretty well but I'm very frequently (95% of the time) having very very slow OPTIONS queries, delaying any API calls by about 3 seconds.

2 requests, OPTIONS takes 3 seconds

Most of this time is spent downloading an empty content:

Downloading an empty content takes 3 seconds

It gets even weirder when I'm trying this on another website we made using a similar architecture, experiencing the exact same problem.

A few other things I tried:

  • I've been trying this with Firefox and Safari, and didn't get any delay.
  • I've been trying this locally or in production, experimenting the same delay.
  • I've been trying this with incognito mode (no extensions), and I have the exact same problem.

We're using on the back-end NodeJS with the CORS package.

Now, I have no idea if the problem is on either Chrome 60, NodeJS, the CORS package or EmberJS + jQuery.

Anyone experienced this too?




Aucun commentaire:

Enregistrer un commentaire