CARVIEW |
Select Language
HTTP/2 301
location: https://raw.githubusercontent.com/nbubna/store/master/src/store.cache.js
accept-ranges: bytes
age: 0
date: Mon, 21 Jul 2025 15:58:50 GMT
via: 1.1 varnish
x-served-by: cache-bom4747-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1753113529.177486,VS0,VE992
vary: Accept-Encoding
x-fastly-request-id: f66ae235ea0a4586efdc911f2c67d7f481df8dd3
content-length: 0
HTTP/2 200
cache-control: max-age=300
content-security-policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
content-type: text/plain; charset=utf-8
etag: W/"89bd7cf13938d5d0174101701b9b6079fc9795226c395f2a855948d650033955"
strict-transport-security: max-age=31536000
x-content-type-options: nosniff
x-frame-options: deny
x-xss-protection: 1; mode=block
x-github-request-id: DE04:3748E6:12AA9:28328:687E63BA
content-encoding: gzip
accept-ranges: bytes
date: Mon, 21 Jul 2025 15:58:50 GMT
via: 1.1 varnish
x-served-by: cache-bom4744-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1753113530.221343,VS0,VE250
vary: Authorization,Accept-Encoding
access-control-allow-origin: *
cross-origin-resource-policy: cross-origin
x-fastly-request-id: 29a137b9f6ed77ab5a9f2187b61024e7a0a02c75
expires: Mon, 21 Jul 2025 16:03:50 GMT
source-age: 0
content-length: 887
/**
* Copyright (c) 2013 ESHA Research
* Dual licensed under the MIT and GPL licenses:
* https://www.opensource.org/licenses/mit-license.php
* https://www.gnu.org/licenses/gpl.html
*
* Allows use of a number as 'overwrite' param on set calls to give time in seconds after
* which the value should not be retrievable again (an expiration time).
*
* Status: BETA - useful, needs testing
*/
;(function(_) {
var prefix = 'exp@',
suffix = ';',
parse = _.parse,
_get = _.get,
_set = _.set;
_.parse = function(s, fn) {
if (s && s.indexOf(prefix) === 0) {
s = s.substring(s.indexOf(suffix)+1);
}
return parse(s, fn);
};
_.expires = function(s) {
if (s && s.indexOf(prefix) === 0) {
return parseInt(s.substring(prefix.length, s.indexOf(suffix)), 10);
}
return false;
};
_.when = function(sec) {// if sec, return sec->date, else date->sec
var now = Math.floor((new Date().getTime())/1000);
return sec ? new Date((now+sec)*1000) : now;
};
_.cache = function(area, key) {
var s = _get(area, key),
sec = _.expires(s);
if (sec && _.when() >= sec) {
return area.removeItem(key);
}
return s;
};
_.get = function(area, key) {
var s = _.cache(area, key);
return s === undefined ? null : s;
};
_.set = function(area, key, string, sec) {
try {
if (sec) {
string = prefix + (_.when()+sec) + suffix + string;
}
_set(area, key, string);
} catch (e) {
if (e.name === 'QUOTA_EXCEEDED_ERR' || e.name === 'NS_ERROR_DOM_QUOTA_REACHED') {
var changed = false;
for (var i=0,m=area.length; i