caching

Service worker - update cache on new version using skipWaiting()

一个人想着一个人 提交于 2020-04-18 06:12:32
问题 I have implemented Workbox to generate my service worker using webpack. This works - I can confirm revision is updated in the generated service worker when running "generate-sw": "workbox inject:manifest" . The problem is - I have noticed my clients are not updating the cache after a new release. Even days after updating the service worker my clients are still caching the old code and new code will only load after several refreshes and/or unregistering the service worker. For each release I

How to cache static files in ASP.NET Core?

孤街醉人 提交于 2020-04-18 05:52:06
问题 I can't seem to enable caching of static files in ASP.NET Core 2.2. I have the following in my Configure : public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseCors(...); } else { app.UseHsts(); } app.UseHttpsRedirection(); app.UseAuthentication(); app.UseSignalR(routes => { routes.MapHub<NotifyHub>("/..."); }); app.UseResponseCompression(); app.UseStaticFiles(); app.UseSpaStaticFiles(new StaticFileOptions

How to cache entire website first login using cache API (Service Worker)

牧云@^-^@ 提交于 2020-04-18 05:46:47
问题 I have a website with a few pages. I know all URL of the website and asserts and its a PHP based. My main objective is in the first login, I want to cache the entire website. Currently, I used SW to caching by navigation, that works fine. What is the better approach? Following is the code I tried. self.addEventListener('install', function (event) { event.waitUntil( caches.open(CACHE_DYNAMIC_NAME) .then(function (cache) { cache.addAll([ '/assets/app/css/vendor.css', '/assets/app/css/app.css',

Caching only images inside of a service worker

狂风中的少年 提交于 2020-04-17 21:52:04
问题 Following is the code for the SW, all working fine. I was caching all the dynamic pages previously, but this was creating me some issues. Like page DOM changes after users interaction are not reflected next time page view. Always it shows original DOM. SO I have needed the only image caching dynamically. I have commented original code which was caching all content. self.addEventListener('activate', function(event) { console.log('[Service Worker] Activating Service Worker ....', event); /

Caching only images inside of a service worker

我的梦境 提交于 2020-04-17 21:51:51
问题 Following is the code for the SW, all working fine. I was caching all the dynamic pages previously, but this was creating me some issues. Like page DOM changes after users interaction are not reflected next time page view. Always it shows original DOM. SO I have needed the only image caching dynamically. I have commented original code which was caching all content. self.addEventListener('activate', function(event) { console.log('[Service Worker] Activating Service Worker ....', event); /

Caching only images inside of a service worker

孤街醉人 提交于 2020-04-17 21:51:34
问题 Following is the code for the SW, all working fine. I was caching all the dynamic pages previously, but this was creating me some issues. Like page DOM changes after users interaction are not reflected next time page view. Always it shows original DOM. SO I have needed the only image caching dynamically. I have commented original code which was caching all content. self.addEventListener('activate', function(event) { console.log('[Service Worker] Activating Service Worker ....', event); /

Android cache affecting value of variable?

戏子无情 提交于 2020-04-17 20:29:03
问题 I'm using the code below within an Android app. In some phones, the code works correctly as expected. In others, a variable changes its value unexpectedly. Example of LogCat from some tests: 03-27 13:38:59.628 17735-17735/? I/System.out: my_var=1.0 03-27 13:38:59.651 17735-17740/? I/zygote: Do partial code cache collection, code=448KB, data=496KB 03-27 13:38:59.652 17735-17740/? I/zygote: After code cache collection, code=446KB, data=495KB Increasing code cache capacity to 2MB 03-27 13:38:59

Android cache affecting value of variable?

别等时光非礼了梦想. 提交于 2020-04-17 20:28:13
问题 I'm using the code below within an Android app. In some phones, the code works correctly as expected. In others, a variable changes its value unexpectedly. Example of LogCat from some tests: 03-27 13:38:59.628 17735-17735/? I/System.out: my_var=1.0 03-27 13:38:59.651 17735-17740/? I/zygote: Do partial code cache collection, code=448KB, data=496KB 03-27 13:38:59.652 17735-17740/? I/zygote: After code cache collection, code=446KB, data=495KB Increasing code cache capacity to 2MB 03-27 13:38:59

Properly setting up a simple server-side cache

你离开我真会死。 提交于 2020-04-16 05:35:54
问题 I'm trying to set up a server-side cache properly and I'm looking for constructive criticism on the setup I have currently. The cache is loaded when the Servlet starts and never changed again, so in effect it's a read-only cache. It obviously needs to stay in memory for the lifetime of the Servlet. Here's how I have it set-up private static List<ProductData> _cache; private static ProductManager productManager; private ProductManager() { try { lookup(); } catch (Exception ex) { _cache = null;

Properly setting up a simple server-side cache

∥☆過路亽.° 提交于 2020-04-16 05:33:10
问题 I'm trying to set up a server-side cache properly and I'm looking for constructive criticism on the setup I have currently. The cache is loaded when the Servlet starts and never changed again, so in effect it's a read-only cache. It obviously needs to stay in memory for the lifetime of the Servlet. Here's how I have it set-up private static List<ProductData> _cache; private static ProductManager productManager; private ProductManager() { try { lookup(); } catch (Exception ex) { _cache = null;