Page 1 of 2

delete cache

Posted: Wed Jan 27, 2021 10:39 am
by Stefan
Can I use Spiderbasic to delete the cache of the browser and the cache of the images in the browser?

Re: delete cache

Posted: Wed Jan 27, 2021 11:20 am
by Peter
Stefan wrote:Can I use Spiderbasic to delete the cache of the browser and the cache of the images in the browser?
untested:
[b]Kevin Hakanson on StackOverflow[/b] wrote:You can call window.location.reload(true) to reload the current page. It will ignore any cached items and retrieve new copies of the page, css, images, JavaScript, etc from the server. This doesn't clear the whole cache, but has the effect of clearing the cache for the page you are on.

Code: Select all

! window.location.reload(true);

Re: delete cache

Posted: Wed Jan 27, 2021 2:33 pm
by Stefan
Where does the code go? No matter where I insert it, I get an endless loop and the page reloads again and again.

Re: delete cache

Posted: Wed Jan 27, 2021 3:30 pm
by Peter
Stefan wrote:Where does the code go? No matter where I insert it, I get an endless loop and the page reloads again and again.
Put it into a procedure and call it, when a button is clicked (for example)

Re: delete cache

Posted: Wed Jan 27, 2021 7:00 pm
by Stefan
Okay,thank you, but that's not what i wanted. I would like a page to run automatically without considering the page's cache and the image cache. Is this possible?

Re: delete cache

Posted: Wed Jan 27, 2021 8:53 pm
by Peter
Is there a particular reason for this need?

You can try to use my HtmlPreprocessor to inject the following lines into the head-section of the SpiderBasic index.html - File

Code: Select all

<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-store" />
<meta http-equiv="expires" content="-1" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />

Re: delete cache

Posted: Thu Jan 28, 2021 4:20 pm
by Stefan
Unfortunately none of this works.
I have a homepage that constantly changes the pictures, but the names of the pictures remain the same. And so the browser does not load the new pictures because it still has the old pictures in the cache.

Re: delete cache

Posted: Thu Jan 28, 2021 4:38 pm
by Peter
then try the following::

Code: Select all

LoadImage(#YourImage, "[SomePath]/YourImage.png?rnd=" + ElapsedMilliseconds())

Re: delete cache

Posted: Wed Feb 24, 2021 7:45 am
by Stefan
Unfortunately I dont understand what you mean.
I load a picture in this way:

Code: Select all

 LoadImage(#mypic,"myfolder/mypic17.jpg")
On wihich way I shoult load mypic17.jpg now?

Re: delete cache

Posted: Wed Feb 24, 2021 7:55 am
by Peter

Code: Select all

LoadImage(#mypic,"myfolder/mypic17.jpg?rnd=" + ElapsedMilliseconds())