Micheal
Micheal

Reputation: 2322

javascript files being cached inspite of changes

<META http-equiv=Content-Type content="text/html;">
<META content="MSHTML 6.00.2900.3314" name=GENERATOR></HEAD>


<?php $current_time="D M j G:i:s"; ?>
<script language="javascript" src="JAVA/ClientSideScript.js?time=<?php echo date($current_time,time()); ?>"></script>
<script language="javascript" src="JAVA/valid_check.js?time=<?php echo date($current_time,time()); ?>"></script>

I have added the above code to prevent caching javascript files. It looks to work fine when I view the source. But I get this message from other people that they dont see the timestamp when they view the source code.

Upvotes: 1

Views: 109

Answers (1)

goat
goat

Reputation: 31813

If you're suggesting that they see this

<script language="javascript" src="JAVA/ClientSideScript.js"></script>

without any remnants of your ?time= additions, then they have likely cached the html file. either have them refresh via f5 key, or change the filename in all pages linking to that html file, forcing a fresh load.

Upvotes: 2

Related Questions