-
Notifications
You must be signed in to change notification settings - Fork 94
Open
Description
Browsers cache the json returned from a html links
Ideally, Exhibit is using the latest json data.
We can prevent caching by appending a random number:
<link href="senators.json?i=232323.232323" type="application/json" rel="exhibit-data" />
We can generate this HTML dynamically
// create an HTML head link with optional cache buster
function loadExhibitResource(file, opts ){
if (opts && opts.cache && opts.cache === 'no') file += "?i="+(Math.random()*99999999);
var link = document.createElement("link");
link.href = file;
link.type = 'application/json';
link.rel = 'exhibit-data';
document.getElementsByTagName("head")[0].appendChild(link);
}
loadExhibitResource('senators.json', {cache: no} );
Metadata
Metadata
Assignees
Labels
No labels