You cannot get the URL of the page that the user will use in the function unload, or in general (in some cases this will be a privacy risk). And the fragment identifier (hash) at the URL will not interfere with caching; changing it will not even reload the page. For caching, you will need to write the part of the ?queryURL that you can do, for example. location.search= '?'+Math.random();.
. , / , , . script DOM:
<span id="counter" class="remaining-300"></span>
, span .className script, JS:
<span id="counter"></span>
<script type="text/javascript">
var remaining= 300;
</script>
reset 300 .
"bfcache", , script - , , "".
, , , , , . , , - - , . , , , , bfcache , onunload , , .