pdf documents will have a cache busting
<script type="text/javascript"> | |
jQuery(document).ready(function($){ | |
// All pdf documents will have a cache busting | |
// string added to its url | |
$("a[href $='.pdf']").click(function(){ | |
var now = new Date().getTime(); | |
$(this).attr('href', $(this).attr('href') + '?cache=' + now ); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
I had a need to cache a pdf file and came up with this idea.
It takes the link to the pdf file and adds a random number to the query that will stop the browser from caching the file, in this case a pdf.
It can easily be modified for any link type