How to completely prohibit caching of the administrative part of the site? #479
Replies: 4 comments 6 replies
-
You can use the exposed middleware CacheResponse and DoNotCacheResponse per route or route group to allow/prevent the caching behaviors, as in https://github.com/spatie/laravel-responsecache?tab=readme-ov-file#preventing-a-request-from-being-cached |
Beta Was this translation helpful? Give feedback.
-
Laravel 10. I added to the app/Http/Kernel.php file:
Next, I added to the /routes/web.php file:
I expected to get a caching of the front -end of my site, but nothing happens. Next, I changed the record to caching one content page, but received a 500 error. |
Beta Was this translation helpful? Give feedback.
-
It is possible that my file /routes/web.php is not complete:
I still have to add to the code of this file? |
Beta Was this translation helpful? Give feedback.
-
How to completely prohibit caching of the administrative part of the site?
My site on Laravel 10 has an administrative part https://mysite.com/admin
The administrative part of the site has links of the type:
https://mysite.com/admin/system/users/profile/1
https://mysite.com/admin/pages
https://mysite.com/admin/pages/edit/22
In which directory should I create a file and what code to write to this file in order to completely prohibit the pages of the administrative part of the site?
I ask for help.
Beta Was this translation helpful? Give feedback.
All reactions