metazoan on Nostr: Good Morning All! wondering how large can a post be?. adding some ...
Good Morning All! wondering how large can a post be?. adding some blogger.serviceWorker.js
const assets = [
"/",
"css/style.css",
"js/app.js",
"/images/blog1.jpg",
"/images/blog2.jpg",
"/images/blog3.jpg",
];
const BLOGGER_ASSETS = "blogger-assets";
self.addEventListener("install", (installEvt) => {
installEvt.waitUntil(
caches
.open(BLOGGER_ASSETS)
.then((cache) => {
console.log(cache)
cache.addAll(assets);
})
.then(self.skipWaiting())
.catch((e) => {
console.log(e);
})
);
});
self.addEventListener("activate", function (evt) {
evt.waitUntil(
caches
.keys()
.then((keyList) => {
return Promise.all(
keyList.map((key) => {
if (key === BLOGGER_ASSETS) {
console.log("Removed old cache from", key);
return caches.delete(key);
}
})
);
})
.then(() => self.clients.claim())
);
});
self.addEventListener("fetch", function (evt) {
evt.respondWith(
fetch(evt.request).catch(() => {
return caches.open(BLOGGER_ASSETS).then((cache) => {
return cache.match(evt.request);
});
})
);
})
Published at
2022-12-19 14:08:40Event JSON
{
"id": "650691ef074adca02117d1da92ebf56b9c479ce6f82692f3de640500b4afd7b7",
"pubkey": "9ff7c34b0359f3b4060dd57af0eb2a9f546f1e167733aebbb1cf4016dc6d0897",
"created_at": 1671458920,
"kind": 1,
"tags": [],
"content": "Good Morning All! wondering how large can a post be?. adding some blogger.serviceWorker.js\n\nconst assets = [\n \"/\",\n \"css/style.css\",\n \"js/app.js\",\n \"/images/blog1.jpg\",\n \"/images/blog2.jpg\",\n \"/images/blog3.jpg\",\n];\n\nconst BLOGGER_ASSETS = \"blogger-assets\";\n\nself.addEventListener(\"install\", (installEvt) =\u003e {\n installEvt.waitUntil(\n caches\n .open(BLOGGER_ASSETS)\n .then((cache) =\u003e {\n console.log(cache)\n cache.addAll(assets);\n })\n .then(self.skipWaiting())\n .catch((e) =\u003e {\n console.log(e);\n })\n );\n});\n\nself.addEventListener(\"activate\", function (evt) {\n evt.waitUntil(\n caches\n .keys()\n .then((keyList) =\u003e {\n return Promise.all(\n keyList.map((key) =\u003e {\n if (key === BLOGGER_ASSETS) {\n console.log(\"Removed old cache from\", key);\n return caches.delete(key);\n }\n })\n );\n })\n .then(() =\u003e self.clients.claim())\n );\n});\n\nself.addEventListener(\"fetch\", function (evt) {\n evt.respondWith(\n fetch(evt.request).catch(() =\u003e {\n return caches.open(BLOGGER_ASSETS).then((cache) =\u003e {\n return cache.match(evt.request);\n });\n })\n );\n})",
"sig": "35199f031b4eb18ab90d1f9e62d4acb6f98cd61e485382acfe2587177ae082073ccbef2f00b13480573264c86f630838bff245f5b19cb3b898b45bc6e6c0e147"
}