I have a problem that I can't solve. I'm new to web-developing, and I coded my first web-site, bought a domain and hosting, and added my files to the public.html folder.
Whenever I change the code, either in css or js and delete the previous files in the public.html folder and then add new ones under the same name with which the code was changed, when I load the site, either by phone or desktop the site looks and all elements remain the same that I haven't changed the code at all, if I change the names of the html, css and js files, I link them and insert them that way, it only shows me a list of files in the public.html folder. The only time the code update works is when I open the site in incognito mode for browsers.
My assumption is that there are some problems with cookies and cached data, but even when I delete them in browser, the code is not updated but the site uses old files.
Does anyone know some solution to my problem, otherwise I use domain and hosting from hostinger and I haven't changed any settings in domen and hosting since I bought it.
Thank you all.
CodePudding user response:
Seems like a caching issue only, you can try implementing https://sebhastian.com/javascript-versioning/
CodePudding user response:
Probably your browser reads from it's cache. Either try disabling browser cache from your browser settings or open your project on your browsers "hidden-private" mode since this mode doesn't do caching.
Also there're some http headers that tells the user to do browser caching or not which you can simply set true or false as I recall. Try googleing this, thus just before returning your page set this header to your response so any other user will be able to see the changes you made, on normal browser mode since it doesn't do caching anymore.
