Skip to content

Cookbook: bust

Eugene Lazutkin edited this page Nov 26, 2019 · 5 revisions

Just including io.bust activates it.

See How to include for more details. See bust for the full documentation.

Simple cache-busting

var req = io.get({
  url: 'abc',
  bust: true
});
// generates following url: abc?io-bust=1470185125354-507943

Bust with a custom key

var req = io.get({
  url: 'abc',
  bust: 'xyz'
});
// generates following url: abc?xyz=1470185125354-507943

Bust with other query values

var req = io.get({
  url: 'abc',
  bust: true
}, {a: 1});
// generates following url: abc?a=1&io-bust=1470185125354-507943

Bust POST

var req = io.post({
  url: 'abc',
  bust: true
}, {a: 1});
// generates following url: abc?io-bust=1470185125354-507943
// the payload {a: 1} is sent as a body

Clone this wiki locally