Skip to content

Conversation

@baprx
Copy link

@baprx baprx commented May 30, 2025

No description provided.

skipWaiting: true, // Force the waiting service worker to become the active service worker
clientsClaim: true, // Take control of uncontrolled clients as soon as the service worker becomes active
maximumFileSizeToCacheInBytes: 6000000, // 6MB
navigateFallbackDenylist: [/^\/eapi\/.+/], // Prevent caching of external API routes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

am not sure why we need this ? for eapi

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the service worker serves requests from cache and we end up being served the 404 error page for API routes.
The only way to have the actual API response when directly accessing an API endpoint is by doing a hard refresh in the browser. It's the same for /apiendpoint by the way (you can try the /api/v1/resource endpoint in your browser) but since /eapi is supposed to be an external API I think it shouldn't be cached.

I was playing with the /eapi route but I changed my strategy so I won't be using it in the end, if you don't want this change it's fine for me.

@baprx baprx force-pushed the feat/chores-timezone branch from 70afcf2 to e0e3bdd Compare May 31, 2025 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants