Skip to content
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

Cache Reworking #297

Open
adambreznicky opened this issue Dec 15, 2020 · 4 comments
Open

Cache Reworking #297

adambreznicky opened this issue Dec 15, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request frontend ideas

Comments

@adambreznicky
Copy link

after the recent create-react-app package update and it's dropping use of 'precache' files, it has become more significant that datahub's cache management should probably be reworked.
in terms of onload, @ctrepka wrote in the deletion of browser precache and @adambreznicky wrote in stashing/monitoring of the app version within local storage. these steps work but only to the extent that the user hard resets (CTRL+F5) their browser to pull these updates. the proposed reworking should maneuver around any necessity for our users to have to hard reset and clear their cache within their client side browser.
should cache-control meta tags within html be used to prevent any client side caching ever? how would this effect performance? are there other methods to prevent client side caching?
if possible, what generic code can be written (along the lines of version management in local storage) to signal a refresh?

a team meeting to brainstorm and analysis of our options would help kick off this enhancement

precache removal on load 6eccfa2
local storage app version c980906

@JasonKleinert
Copy link
Contributor

Here are some relevant resource links with ideas related to caching with PWAs:

@ctrepka
Copy link

ctrepka commented Dec 17, 2020

Still reading the articles you linked @JasonKleinert, but here are a few updates specifically about react-scripts v4.0^ and its adoption of the workbox api for creating PWAs. Wondering if this might just be a matter of updating the service-worker files in the repo?

@ctrepka ctrepka closed this as completed Dec 17, 2020
@ctrepka ctrepka reopened this Dec 17, 2020
@JasonKleinert
Copy link
Contributor

@ctrepka we could disable the service worker in our src/index.js file? When I initially built the React app I left the service worker in there because it came as part of the standard set up. There isn't a specific need for this app to be a PWA. The new support for the workbox api could make using a service worker more straightforward in the future if that is what we want to pursue. Should we try disabling the service worker and the code added to manage clearing the cache to see if this solves the issue of the app loading from cache and not recognizing when new updates are deployed?

@ctrepka
Copy link

ctrepka commented Dec 18, 2020

@ctrepka we could disable the service worker in our src/index.js file?

I think this might work, and is probably worth a shot. I tried yesterday in local production mode (npm run build and served with webpack). It's still not clear to me if it worked or not, honestly, and I think we will need to find someone with a cached version to test in prod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend ideas
Projects
None yet
Development

No branches or pull requests

4 participants