I am currently buiding an application with a Laravel API and a Vuejs frontend. For the API I am using the spatie/laravel-responsecache
package to handle caching.
If I visit a url directly e.g. http://api.mysite.com/users
then it fetches the data and caches it correctly.
However, if a url e.g. http://api.mysite.com/messages
(one that I have not directly visited) is fetched via axios on the frontend, it is not cached. Again, if I then go and visit it directly, its cached, and then if I fetch it from the frontend it is cached.
How can I force axios to use the server side caching without me having to preload the url?