There is a client application that loads javascript from a remote server as follows:

<script type="text/javascript" src="http://192.168.0.1/ind.php"></script> 

In ind.php there is a script that sends different JS scripts. The problem is that the client saves the first script and later uses only it. It is necessary to make so that each time a new request is sent to the server. Tried to ban as follows:

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

Did not help. It seems you can somehow generate random requests ... But I don’t quite understand how.

    2 answers 2

    Try:

     <?php header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); ?> 
    • no, it did not help - toog

    If simple, you can constantly load a new script:

     <script type="text/javascript" src="http://192.168.0.1/ind.php?v={$time}"></script> 

    so the browser will constantly pull the new script.

    • Did not quite understand, and write? Or is time a variable and need to be identified? - toog
    • Identify, depending on how long you need the time of life porridge. And if he isn’t needed at all then stupidly there time () - Redr01d