-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/2985 - a.k.a "localStorage saver" #3180
Conversation
Looks good, i have nothing to add:) |
… available storage strategies
I've just changed the config property names changing the |
hi @pkarw I started vsf with devServiceWorkerr=true ( |
@alinadivante thanks for testing this out! Regarding this error - it's not related to the changes included in this PR. It's the reason of "QA rejected"? :-( |
@pkarw yes, it was the reason :P I didn't notice this error before, so I assumed that your changes are causing it. If not, I think the rest is fine. |
Related issues
This is related to #2985
Short description and why it's useful
I've decreased the
localStorage
quota usage + error handling by introducing new config variables:config.products.disablePersistentProductsCache
to not store products by SKU (by default it's on). Products are cached in ServiceWorker cache anyway so theproduct/list
will populate the in-memory cache (cache.setItem(..., memoryOnly = true)
);config.seo.disableUrlRoutesPersistentCache
- to not store the url mappings; they're stored in in-memory cache anyway so no additional requests will be made to the backend for url mapping; however it might cause some issues with url routing in the offline mode (when the offline mode PWA installed on homescreen got reloaded, the in-memory cache will be cleared so there won't potentially be the url mappings; however the same like withproduct/list
the ServiceWorker cache SHOULD populate url mappings anyway);config.syncTasks.disablePersistentTaskQueue
to not store the network requests queue in service worker. Currently only the stock-check and user-data changes were using this queue. The only downside it introuces can be related to the offline mode and these tasks will not be re-executed after connectivity established, but just in a case when the page got reloaded while offline (yeah it might happen using ServiceWorker;syncTasks
can't be re-populated in cache from SW)If by some reasons you wan't to have the
localStorage
back on forProducts by SKU
,Url Routes
andSyncTasks
- please juset set these variables back tofalse
in yourconfig/local.json
.Upgrade Notes and Changelog
IMPORTANT NOTICE - Remember to update
CHANGELOG.md
with description of your changeContribution and currently important rules acceptance