I have simple laravel application and I use simple blade template. I have navigtion, imageine two routes: main
and contact
. when I enter website, main html file loads, it takes about 2 seconds. then I go to contact page, it loads in 2 seconds too. when I navigate to main page, it loads this page from zero, and it takes still 2 seconds. So is there any possible workaround to cache this already visited routes? so when I navigate back to main page, it won't be necessary to wait this 2 seconds again?
You can cache the routes with php artisan route:cache
, and cache the views with php artisan view:cache
I think what you mean is to store the Site in a cache that deploys it back to the user on no time, check out PHP Varnish then.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.