Search This Blog

Saturday, March 12

How to avoid optimize command for every small changes in laravel

Issue:

I have made some changes on a Blade file using a text editor and then refreshed my page but was unable to see newly added content and noticed that (it's loading the old content from the Blade file).

code in route(web.php)

Route::get('about', function () {    return view('about');      });

// code in view file(about.php)

<p>some text in about file</p>

I've tried the following:

php artisan optimize

then It worked fine i.e new added html lines visible but why for every small changes I need to optimize server.


Solution:

    Try running " php artisan optimize:clear " once. After that, the response shouldn't be cached anymore. When running " php artisan optimize " you simply refresh your cache rather than removing it completely.

No comments:

Post a Comment