We’re experiencing intermittent slow page loads on our Netlify website. Some debugging points to what seems to be an intermittent bug in Netlify web servers related to caching and compression. I’ve searched the forums but couldn’t find a post on this issue.
Usually the browser correctly uses the cached version, since the server returns HTTP 304. However in some cases, the browser re-downloads the resource since the server returns HTTP 200, even though the browser sent a correct If-None-Match header. It seems that in those ‘cache miss’ requests, the server returns a wrong ETag header which does not include the
-df suffix (even though the request was for the compressed resource).
I’ve verified this in two ways:
Accessing the above URL in my browser (Chrome) with the DevTools open, and seeing that sometimes HTTP 200 is sent instead of HTTP 304, even though the browser sent If-None-Match correctly.
Using curl with the following command:
curl --compressed "https://cantamus.app/packages/verovio-3.3.0/verovio.js" -H "If-None-Match: f1ee2cc0ca9c51f2d05575f8c1436407-ssl-df" -I
And observing that this request intermittently gives 200 and 304 responses. See screenshot below of two such requests (but I’ve reproduced this dozens of times).
Needless to say the resource itself is not being updated.