Hi
I'm looking for a script that can clear browser cache at page load.
Or is it possible to clear cache only of images?
Hi
I'm looking for a script that can clear browser cache at page load.
Or is it possible to clear cache only of images?
You can't. The End.
Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
Currently: enjoying the early holidays :)Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide
Well.... I wouldn't say the end. it is possible on some degree, but very intrusive and I haven't yet seen a method that works correctly.
You certainly cannot do it with an SSI language or a script. And certainly not without the users knowledge (read: permission).
Perhaps though, we need more information from the O.P. as to a why, perhaps there is something s/he wants done that can be accomplished without clearing cache. Perhaps.
{CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
Follow Me on Twitter: @Negative_Chaos
PHP Code:$result = mysql_query("SELECT finger FROM hand WHERE id=3");
echo $result;
Security issue and completely impossible, but it might be possible to solve the problem another way, or attach a no-cache header for a page that must reload each time, etc. Once it is on the computer, though, nothing can be done, at all, short of invading the computer with ActiveX or a Java applet, at which point you could just as easily rename their C drive as delete their cache.
Daniel - Freelance Web Design | <?php?> | <html>| Deutsch | italiano | español | português | català | un peu de français | Ninasoma Kiswahili | 日本語の学生でした。| درست العربية
hmm.. Here's my problem. We update news on our website with own CMS System. Each time the news are updated, images of old news are left in browser cache so viewers need to refresh the browser 2 to 3 times (several sometimes) to get the correct images.
Couple things.
In the <head> section add meta tag:
Basically the browser won't cache the page.Code:<meta http-equiv="pragma" content="no-cache" />
Another option is to set sessions, this will force the browser to a new session each time they go, and thus make the browser get the page from the server instead of the cache
PHP Code:<?php
session_start();
$_SESSION = array();
session_destroy();
?>
{CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
Follow Me on Twitter: @Negative_Chaos
PHP Code:$result = mysql_query("SELECT finger FROM hand WHERE id=3");
echo $result;
I'll try the first one. Can't try second as my page is written with asp.net
You could also add a random variable to the end of the image:
<img src="image.jpg?state=[random]">
like state=29422488713, then it will think it's a new image each time, and reload it.
Daniel - Freelance Web Design | <?php?> | <html>| Deutsch | italiano | español | português | català | un peu de français | Ninasoma Kiswahili | 日本語の学生でした。| درست العربية
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
i created an account here only so i could share my dissapointment with this community.
real programmers know nothing is impossible, but rather different approaches may be preferred because they're easier.
this thinking of, 'it isn't possible' is completly ridiculas. i could tell you how it would be possible myself.
the biggest problem: finding out how to compile assembly language inside of javascript. even if you have to dynamically create a text-file, save it as .cpp, and compile it with a mini-compiler; it's possible.
once you have it in assembly.... it's easy. there's not really any such thing as 'security' in the __asm language.
go ahead, argue with me that what's described above is 'impossible'
i'll post my code when i have a javascript cookie clearer, if i feel you guys are worthy<3
Bookmarks