Support the ongoing development of Laravel.io →
posted 10 years ago
Configuration
Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

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?

Last updated 2 years ago.
0

i keep on facing this problem from time to time and the only solution that works for me is disabling opcache and reload vagrant

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

nvanselow nvanselow Joined 30 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.