I know that as a user myself, I can just hit ‘F5’ to make sure, or clear my cache, etc.
I’m just wondering if there’s anything from a web designer standpoint that can make this more “automatic,” as many users may not know to do that.
For dynamic sites, this can be done with server-side “magic.”
It seems that some answers to similar questions imply editing .htaccess in some way, so I’m going to investigate this. However, if anyone has a “quick tip” or code snippet that will work for a static site, that would be great.
The only PHP used on the site is for the contact form so it can automatically send off the email. The rest of the site is just images, text, etc.
You can’t clear the cache with some sort of JS solution, but what you can do, is that with each new deployment / update to your website add a fake version/etc number to the end of your css/js.
For example:
Next time you update, just change it slightly:
main.css?v=1.51and when a user goes to visit your site again, since the URL will be different it will automatically reload it, ensuring they are using the most up-to-date style sheet.