Skip to content

Conversation

@LukasFrm
Copy link
Contributor

@LukasFrm LukasFrm commented Oct 13, 2025

A draft PoC for JIRA: WS-1396 SPIKE: Lite site homepage caching in offline mode

Summary

A PR to showcase lite site homepage and most read articles caching capabilities.

Code changes

  • Updated the service worker version
  • Introduced environment-based caching (local pages on local, BFF fetched pages for other environments)
  • Added parsing most read canonical articles endpoint --> converting canonical URLs to .lite --> fetching and caching the .lite articles
  • Added temporary logs to debug different service worker lifecycle events

Developer Checklist

  • UX
    • UX Criteria met (visual UX & screenreader UX)
  • Accessibility
    • Accessibility Acceptance Criteria met
    • Accessibility swarm completed
    • Component Health updated
    • P1 accessibility bugs resolved
    • P2/P3 accessibility bugs planned (if not resolved)
  • Security
    • Security issues addressed
    • Threat Model updated
  • Documentation
    • Docs updated (runbook, READMEs)
  • Testing
    • Feature tested on relevant environments
  • Comms
    • Relevant parties notified of changes

Testing

  • Manual Testing required?
    • Local (Ready-For-Test, Local)
    • Test (Ready-For-Test, Test)
    • Preview (Ready-For-Test, Preview)
    • Live (Ready-For-Test, Live)
  • Manual Testing complete?
    • Local
    • Test
    • Preview
    • Live

Additional Testing Steps

  1. List the steps required to test this PR.

Useful Links

@LukasFrm LukasFrm marked this pull request as draft October 13, 2025 08:31
@LukasFrm LukasFrm added the POC label Oct 13, 2025
@LukasFrm LukasFrm changed the title Lite site caching PoC WS-1396: Lite site caching PoC Oct 20, 2025
DmitryGron and others added 2 commits October 20, 2025 12:53
…rolled format string

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Copy link
Contributor

@andrewscfc andrewscfc left a comment

Choose a reason for hiding this comment

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

few questions to aid my understanding 👍

return response;
})(),
);
} else if (isRequestForMostRead) {
Copy link
Contributor

Choose a reason for hiding this comment

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

where is this variable defined? I can't find it anywhere on the diff?

)}`;
const HOME_PAGE_URL = `${getEnvConfig().SIMORGH_BASE_URL}/${service}`;

const fetchMostReadItems = async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

why can't this request be made from within the service worker?

const cache = await caches.open(cacheName);
if (hasOfflinePageFunctionality) {
await cache.add(OFFLINE_PAGE);
await cacheMostReadStories(cache);
Copy link
Contributor

Choose a reason for hiding this comment

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

where is this function defined?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants