Commits
Click on a commit to change the comparison rangefix(service-worker & cache): remove checkCachedVersionMatchesOnChain
1. Fixed the issue of the caching mechanism in the service worker.
2. Updated the CACHE_EXPIRATION_TIME to 1 hour.
The resolveObjectId function would only be called on the site::Site
object and not for each Resource (which makes sense as it is doing
the suins-to-objectId resolution).
However, this meant that a lot of requests would be
tagged as "cache miss" incorrectly, because the
site::Site version would be compared with the
site::Resource version inside the checkCachedVersionMatchesOnChain.
Thinking more about it, the end goal of using a cache
is to avoid making requests to the RPC nodes.
Always checking for the sui object version contradicts this.
Therefore I decided to remove the checkCachedVersionMatchesOnChain
altogether.
Remember that caches expire, so at some point the resource
contents will be updated anyway. Reduce CACHE_EXPIRATION_TIME to 1 minute