CakePHP: HTTP Header is being interpreted as part of my static content (JS, CSS)

我的梦境 提交于 2019-12-11 11:54:39

问题


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:

When the static content is JavaScript, it triggers a 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.

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

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

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

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.

来源:https://stackoverflow.com/questions/31754298/cakephp-http-header-is-being-interpreted-as-part-of-my-static-content-js-css

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!