I’m in the process of writing a custom CMS solution for a client of mine which generates JavaScript files based on the active site
public ActionResult Javascript(string filename)
{
var fileLocation = Server.MapPath(string.Format("~/Views/SiteFiles/{0}/js/{1}", Profile.SiteSlug, filename));
if (!System.IO.File.Exists(fileLocation))
fileLocation = Server.MapPath(string.Format("~/js/{0}", filename));
return JavaScript(System.IO.File.ReadAllText(fileLocation));
}
Basically, it checks the current sites folder to see if the Javascript file exists there, if it doesn’t, it tries to load it from the root js folder, while all the urls look like the files are located in the same folder
The call to the file usually works the first time, and sometimes multiple times, but randomly without changing anything, I begin to get a message from Firefox

Chrome shows this message

When I try to decode the Response from Fiddler, I get this message

I’m really confused as to what is going on, and what I need to do to fix it
I ended up disabling static and dynamic content compression on the Website is IIS and it started working, not sure why it would have been compressing it sometimes and not others, still going to dig deeper into the issue when I get time