In order to develop cool, I win7 under the VBox, shared folders, development environment set in VBox in CentOS. But when you save the JS file, there are some inexplicable things, the browser will read the JS file error. However, this file is normal as long as it is opened and saved in Linux.
Tried a lot of methods, than how to save file format, Utf8,utf8 BOM, etc., useless
Is there a difference between saving files under Linux and Win7 (the format of Win7 shared files is NTFS)
Reply to discussion (solution)
I didn't use VBox.
I use Samba, win map Samba directory, win with NetBeans or EditPlus write JS no problem
Do not know your JS error message is what
Echo Base64_encode (file_get_contents (' Problematic JS file '));
Output to Base64, Byond compare exactly the same
It doesn't make sense. js file is a problem with browser parsing.
For the next preservation of the wool Linux can be used?
I'm guessing the nginx cache problem is looking for this problem
Yes, I want to see what's inside.
You won't show it to me, then forget it.
The problem is clear, but no solution is found.
I changed a JS file under Windows, then the browser access, error, I am under Linux cp this file, and then delete it, then the backup file CP back to the original file, OK.
That is, Nginx caches the mischief.
I set the static file access cache expires to off
Will introduce the file plus a changed version number, or can not solve the problem
It is also important to note that the format of the shared folder is vboxsf, which may not function properly with the Linux sendfile module. Some common Web servers such as Nginx and Apache, if the Sendfile module is enabled in their configuration file, may cause errors in response to file content to the client. About the specific description of the problem, interested students can Google "vboxsf sendfile" understand. The current recommendation is to refer to the specific configuration methods of these services and disable the Sendfile module to ensure that the contents of the file can be sent correctly.
Perfect solution:
Nginx settings
Sendfile on change to OFF
This is limited to the development environment