I had no issues with Cloudflare + Laravel + VueJS. It didn't matter if it was SPA or not. Both worked flawlessly.
Cloudflare with laravel and Vue(non spa) any good?
Hi all,
I have never used cloudflare with vue.js, does it causes any issues with it? I am using laravel with vue js as a non spa app.
Thanks!
Thank you so much for the kind reply!
One of the problem I have at the moment is that my users do not get all my JS updates at the same time, most of them have to empty their cache to get going. I tried to add the versioning in laravel mix but it is not working with my laravel 6 version unfortunately.
So I was hoping instead to upload my updates and then each time empty the cache on Cloudflare so the users always get the latest files/updates.
Do you think this idea will work?
Thank you.
Versioning worked for me on every Laravel version I had it on. Probably you are missing something. Emptying cache also never caused me any problems.
Only thing with clearing cache is that browser gets the info for how long that asset is valid and there is no need to request new version. So until that time expires it will not request it and your users will have to clear their browser cache.
As I see it you have few options:
- Try to get versioning working
- Try to have as generic CSS as possible, Tailwind-like approach
- Add notification bar that will be visible for first visit per user to notify them that they might have old version of styles and that they should do manual refresh and link to pages where that is explained how to do it
Thanks for the reply. Regarding the point 3, how would you do this please? I have only seen this is a few websites. How would you detect that the user uses an old version and then I believe you would somehow force a cache refresh of their browser when they click on the button.
I would not detect it. I would add it every time I release new version.
I see, something in the bottom corner like: New Version 1.30 released! Empty your browser cache to get it.
Any idea if there is a way to programmatically empty the user browser cache on button click?
Thank you.
I usually put that at the top, but wherever you like it best based on your content.
I never did it programmatically. What I did before is sending metas. Something like following.
<meta http-equiv='cache-control' content='no-cache'>
<meta http-equiv='expires' content='0'>
<meta http-equiv='pragma' content='no-cache'>
Include something like that on a proper condition and you should be good to go.
Please or to participate in this conversation.