v1.10.3
Fix
Prevent random lastVisited order changes on page refresh
- Enhanced refresh detection using cache-control and Sec-Fetch-Site headers
- Added 5-minute throttle on lastVisited updates to prevent rapid reordering
- Prevents false positives from PWA refreshes and service worker interactions
- Ensures stable ordering across multiple refreshes within 5-minute window
Improvement
Streamline service worker fetch handling and improve offline experience
We've made an improvement: Streamline service worker fetch handling and improve offline experience
- Refactored the service worker's fetch event handling to enhance clarity and efficiency. Simplified caching logic for various asset types, including fonts and CSS, and improved handling of network failures with clearer user feedback. Introduced a more robust offline page that informs users when they are offline and provides retry options. Removed redundant comments and optimized code structure for better maintainability.
Fix
Update service worker to remove content pagination endpoint
- Removed the '/api/content/load-more' endpoint from the service worker to prevent ordering issues caused by stale cached data. Updated fetch logic in OrganizedContentList to always bypass cache, ensuring fresh data retrieval and consistent ordering.
Feature
Enhance service worker caching and offline handling
- Introduced a new helper function to check if cached responses are fresh, improving the service worker's ability to serve up-to-date content. Updated the fetch event handler to implement a network-first strategy when online, ensuring stale pages are not served. Adjusted caching headers to reduce cache time and enforce revalidation, aligning with the new strategy. Removed unnecessary refresh logic in OrganizedContentList to prevent race conditions and double refreshes, enhancing data integrity and user experience.
