CARVIEW |
Select Language
HTTP/2 301
location: https://raw.githubusercontent.com/nbubna/store/master/src/store.cache.js
accept-ranges: bytes
age: 0
date: Wed, 23 Jul 2025 05:27:50 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210054-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1753248470.644634,VS0,VE997
vary: Accept-Encoding
x-fastly-request-id: 15dacc7d6a9feb80ee6e967d7010ec90b334bd37
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: 92E1:35E7AD:729FD:16A8CE:688072D6
content-encoding: gzip
accept-ranges: bytes
date: Wed, 23 Jul 2025 05:27:50 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210057-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1753248471.692410,VS0,VE272
vary: Authorization,Accept-Encoding
access-control-allow-origin: *
cross-origin-resource-policy: cross-origin
x-fastly-request-id: cdebdd7e02f52a885134b470db9ad767dc753a9a
expires: Wed, 23 Jul 2025 05:32: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