1

I'm encountering a strange error in my web app running CakePHP 2.6:

Random static content files are taking forever to load, and when they do take forever to load, they don't work properly. These files are living where I generally assumed they were supposed to: /app/webroot/css and app/webroot/js.

In this screenshot, a JS file takes 10 seconds: Static content takes forever to load.

When the static content is JavaScript, it triggers a syntax error: Syntax Error

Previewing the response, we see that the HTTP header is being interpreted as part of the script. The JS engine sees the header and throws a syntax error. enter image description here

This also happens randomly when it's a different HTTP code, like 304 Not Modified: enter image description here

An example of the response when it doesn't take forever to load:

enter image description here

And an example of the header when it doesn't take forever to load: enter image description here

Could there be something I've got misconfigured in my Cake app? The fact that this is happening seemingly randomly is really driving me nuts.

caitlin
  • 2,769
  • 4
  • 29
  • 65
  • Requests for "real", existing files in the `webroot` folder normally never hit PHP at all, such requests are being exluded via `mod_rewrite` and handled directly by Apache. I'd start searching the problem at the Squid side of the story. – ndm Jul 31 '15 at 20:12
  • Not particularly helpful but I've seen these symptoms before. Check the actual headers (or simply the whole response as received) - what are the "valid" headers that are received for one of these borked requests? Are they the headers from a previous request? – AD7six Jul 31 '15 at 21:12
  • A [related question with similar symptoms](http://stackoverflow.com/q/31967457/761202). – AD7six Aug 12 '15 at 15:21
  • Interesting. My issue is intermittent... still trying to track this down. Will update when I encounter it again. – caitlin Aug 12 '15 at 18:52

0 Answers0