Reload page on loading

it should be so simple, but I can’t get it working, all I want to do is refresh my page right after it loads. I do not want to stop caching, since most of the data on my site remains unchanged. I do not want to switch to another URL, for example, www.mysite.com/page1.php?refreshedpage, because my URL is clean and easy to use.

I have images using the same file name that changes, so when a user accesses my site, they see old cached images.

Greetings

+4
source share
1 answer

Add something like the following to your images:

<img src="/images/image.jpg?refresh=20110524" /> 

I just used a date, but you can use whatever you want. This will make the browser think this is a new image and load it instead of using the cache for all users.

No matter which line you use, after the name of the image file, it will load the same image, although the browser will consider it a different image.

+4
source

All Articles