1

I apologize if this has been covered, but I did do an extensive search and could not find the answer.

To start, I am using blade. When I update a view locally, the page updates and displays correctly. However, when I upload the file to my hosted server, I cannot see the changes. I have waited as long as 24 hours and nothing.

At first I thought it was my provider caching from the server, but I disabled that functionality.. and when I delete the files from app/storage/framework/views on the server, the new view will display correctly. So, it is obviously a Laravel thing!

Everything between local and production is the same (with the exception of the .env file) so, I am not sure what else to try.

Any suggestions would be appreciated since my business is literally on hold until I can figure this out.

  • Have you tried clearing the cache with artisan commands? Check out this answer http://stackoverflow.com/questions/29152102/laravel-5-clear-views-cache – Can Celik Sep 20 '16 at 22:54
  • I don't have shell access to my server. Is there a way to do that programmatically? I could just add a line to index.php, I suppose. –  Sep 20 '16 at 22:58
  • Yes you can. https://laravel.com/docs/5.3/artisan#programatically-executing-commands – Can Celik Sep 20 '16 at 23:00

1 Answers1

0

If you don't have a shell access to run artisan commands you can create a dummy route to do that. (Feels like a dirty solution :) )

Route::get('/clearViews', function () {
   Artisan::call('view:clear', []);
   //
});
Can Celik
  • 2,050
  • 21
  • 30
  • This is great...but I am trying to find out why this is happening. I don't want to have to run this command every time I upload an updated view. (no different than just deleting the view files every time) –  Sep 20 '16 at 23:07
  • Do you have an access to php.ini ? – Can Celik Sep 20 '16 at 23:13
  • I believe I have my own personal php.ini, but I do not have direct access to it. Possible that they will update for me... are you thinking about opcache? –  Sep 20 '16 at 23:16
  • Yes. http://stackoverflow.com/questions/25813251/how-do-i-disable-laravel-view-cache and http://stackoverflow.com/questions/20579182/laravel-and-view-caching-in-development-cant-see-changes-right-away – Can Celik Sep 20 '16 at 23:18
  • Laravel as become unusable in the environment I am in. Everything works fine if I clear the view cache manually, but I don't want to do that every time I deploy change to a page... plus, some of the dynamic pages are not rendering correctly when something in the database changes (unless again, I manually clear the view cache). I have been all over the net and cannot find a solution to this problem. Moving on to another framework (regrettably). –  Sep 22 '16 at 02:14
  • So changing opcache.revalidate_freq=0 didn't help? I can almost tell with 100% certainty, that issue is not framework related but good luck. – Can Celik Sep 22 '16 at 19:09
  • I agree that it has something to do with the system as everything works perfectly in my local dev environment. The problem is that Laravel doesn't seem to include anything that helps (except of course, clearing the view cache) –  Sep 23 '16 at 04:59
  • But, to answer your question, correct... changing that value did not help. –  Sep 23 '16 at 23:05