Closed banani720 closed 3 weeks ago
Hey @tjtanjin I'll get right on that, appreciate the feedback!
I had just one question regarding your third bullet, is the idea that the CSS styles text SHOULDN'T be cached?
In the meantime, I've gone ahead and implemented a unique key for cached themes so that they don't overwrite and reworked getCachedTheme
and setCachedTheme
so that they handle undefined versions when setting cache keys. I've also gone ahead and redone the cache theme key to be rcb-theme
in accordance with the naming standards I've seen elsewhere in the repo.
Hey @banani720! Are you still working on this PR? If you require further clarifications feel free to ask 😊
Any updates @banani720? 🥹
Succeeded by #103
Description
This pull request caches the theme data with an expiry date of 30 days to local storage. If a theme exists it is returned and no call to the CDN to get the theme are made
Closes #85
What change does this PR introduce?
Please select the relevant option(s).
What is the proposed approach?
To resolve this issue I simply added cache setting/getting functions in order to check for a cached theme before going to the CDN. If there is no cached theme or it is expired, a call to the CDN is made and the result is then cached for future use. I chose 30 days as an arbitrary number but we can expand or reduce that as needed
Checklist: