I think I figured out a solution. I was able to turn on and off the problem by removing and adding the following code to the nginx configuration file. I am going to watch it for a while and see if the problem remains fixed.
location ~* \.(?:html|css|js|png)$ {
expires modified 1s;
add_header Pragma public;
add_header Cache-Control "public";
}
To edit this file go to the console in the homestead directory (I used gitbash on Windows).
$ vangrant-ssh
//Accesses the VM
$ cd /etc/nginx/sites-available
$ sudo vi {your_domain}
//your_domain will be something like example.app. Use whatever you set in the homestead.yaml file for "sites -map"
Lookup vi commands if you are unfamiliar with using the console based text editor. Then add the code above to that file.
In order for this to take effect, you may need to clear your browser's cache so that the file with the new headers can come from the server instead of being called from the cache.
My solution above did not appear to work. I am still getting some cached html files back. Has anyone else encountered this? Has anyone found a different solution?
i keep on facing this problem from time to time and the only solution that works for me is disabling opcache and reload vagrant
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community