Skip to content

[Performance] Implement service worker for FFmpeg WASM caching #181

Open

Description

@magic-peach

Overview

The FFmpeg WASM bundle (~30MB) is re-downloaded on every page load. Implementing a service worker to cache these files would make subsequent loads near-instant.

Implementation

Create public/sw.js or use Workbox:

// Cache FFmpeg WASM files
const CACHE_NAME = 'ffmpeg-wasm-v1'
const FFMPEG_URLS = [
  'https://cdn.jsdelivr.net/npm/@ffmpeg/ffmpeg@0.12.10/dist/umd/ffmpeg.js',
  'https://cdn.jsdelivr.net/npm/@ffmpeg/core@0.12.9/dist/umd/ffmpeg-core.js',
  'https://cdn.jsdelivr.net/npm/@ffmpeg/core@0.12.9/dist/umd/ffmpeg-core.wasm',
]

Register the service worker in src/app/layout.tsx.

Acceptance Criteria

  • Service worker installed on first visit
  • FFmpeg WASM cached after first download
  • Subsequent loads use cached version
  • Cache invalidation on version update
  • Works offline after first load

Activity

  1. added
    gssoc'26GirlScript Summer of Code 2026
    performancePerformance optimization
    priority: highHigh priority - needs immediate attention
    size: largeLarge issue - significant work required
    on May 13, 2026
  2. vaanni47 commented on May 14, 2026

    @vaanni47

    hi,i'd like to wrok on this.

    I’ll handle the performance bottleneck by implementing a service worker to cache the 30MB FFmpeg WASM bundle, ensuring we don't re-download it on every page load. I plan to create a public/sw.js file—or leverage Workbox—to target the specific CDN URLs for the JS and WASM cores, storing them under a versioned cache. After registering this worker in the main layout file, I'll verify that subsequent loads are near-instant and that the app remains functional offline.

  3. KamnaJ5 commented on May 14, 2026

    @KamnaJ5

    Hi @magic-peach, I’d like to work on this issue under GSSoC 2026.

    I reviewed the issue and understand that the main goal is to reduce repeated FFmpeg WASM downloads by introducing service worker based caching. I plan to:

    • analyze the current FFmpeg loading flow
    • implement caching for the WASM assets using a service worker or Workbox
    • ensure cache versioning/invalidation works correctly
    • verify faster subsequent loads and offline support after initial caching

    Please assign this issue to me. Thank you!

  4. deepsikha-dash commented on May 15, 2026

    @deepsikha-dash

    Hi @magic-peach , I’d like to work on this issue under GSSoC'26.

    I reviewed the issue and understood that the main goal is to avoid repeated FFmpeg WASM downloads by introducing efficient service-worker-based caching.

    My approach would be:
    • analyze the current FFmpeg loading flow and identify the WASM assets being fetched repeatedly
    • implement a service worker (or Workbox-based solution) to cache the FFmpeg JS/WASM bundles with versioned cache storage
    • register the worker in the app layout and ensure proper cache invalidation on updates
    • verify that subsequent loads are significantly faster and that the cached assets continue working offline after the first successful load

    Please assign this issue to me. Thank you!

  5. Lathika226 commented on May 15, 2026

    @Lathika226
    Contributor

    Hi @magic-peach, I’d like to work on this issue under GSSoC’26.

    I explored the current architecture and noticed FFmpeg WASM is lazily loaded through src/lib/ffmpeg.ts, which means users may still need to re-download large FFmpeg assets when cache is invalidated or unavailable. Since the WASM bundle is relatively heavy, this directly impacts startup performance and repeat export experience.

    I’d like to implement a service worker-based caching strategy for FFmpeg assets and related static resources to improve load performance and offline reliability.

    Implementation plan:

    • Add a service worker for static asset caching
    • Cache FFmpeg WASM/core files using a cache-first strategy
    • Implement versioned cache invalidation to avoid stale binaries
    • Reduce repeated downloads after initial initialization
    • Ensure compatibility with static export deployments like Vercel, Netlify, GitHub Pages, and Cloudflare Pages
    • Verify that export functionality and existing workflows remain unaffected
    • Test caching behavior across major browsers

    I’ll also validate offline and repeat-load performance improvements after implementation.

    Please assign this issue to me. Thank you!

  6. added and removed
    performancePerformance optimization
    priority: highHigh priority - needs immediate attention
    size: largeLarge issue - significant work required
    on May 16, 2026
  7. 4 remaining items

  8. magic-peach commented on May 17, 2026

    @magic-peach
    CollaboratorAuthor

    Hey @KamnaJ5 @Lathika226 @deepsikha-dash @vaanni47! 👋

    Thanks for being part of the Reframe community — your engagement on this issue means a lot! 🙌

    If Reframe has been useful to you, please consider ⭐ starring the repo — it helps more developers discover the project and keeps the momentum going!

    Every star helps Reframe grow. It only takes a second! 🎬

  9. github-actions commented on May 17, 2026

    @github-actions
    Contributor

    Claude encountered an error —— View job


    I've analyzed the comment and context. This appears to be a community engagement message thanking contributors and encouraging repo stars, rather than a technical request requiring action.

    According to the repository guidelines, no reply is needed for status updates or acknowledgments that don't contain questions or requests. The issue is already properly assigned to @vaanni47 and no new technical questions were raised.


  10. magic-peach commented on May 18, 2026

    @magic-peach
    CollaboratorAuthor

    Hey @KamnaJ5 @vaanni47! 👋

    You've forked and been contributing to Reframe — thank you so much! 🙌

    If you're finding the project useful, it would mean a lot if you could drop a ⭐ on the repo:
    👉 https://github.com/magic-peach/reframe

    It takes just a second and really helps the project grow in GSSoC'26 and beyond! 🚀

  11. github-actions commented on May 18, 2026

    @github-actions
    Contributor

    Claude encountered an error —— View job


    I'll analyze this and get back to you.

  12. github-actions commented on May 20, 2026

    @github-actions
    Contributor

    Hey @vaanni47, just a friendly reminder that this issue has had no activity for 2 days. Please leave an update or let us know if you need help! ⏰

  13. github-actions commented on May 24, 2026

    @github-actions
    Contributor

    Hey @vaanni47, final warning! ⚠️ This issue has had no activity for 4 days and will be automatically unassigned in 24 hours if there is no update.

  14. github-actions commented on May 29, 2026

    @github-actions
    Contributor

    This issue has been unassigned from @vaanni47 due to 5 days of inactivity and is open for anyone to pick up — comment /assign to claim it!

  15. deepsikha-dash commented on May 30, 2026

    @deepsikha-dash

    /assign

  16. github-actions commented on May 30, 2026

    @github-actions
    Contributor

    Hey @deepsikha-dash, this issue has been assigned to you! 🎉 Please make progress within 5 days or it will be automatically unassigned due to inactivity.

  17. deepsikha-dash commented on Jun 4, 2026

    @deepsikha-dash

    Hi @magic-peach 👋

    Just a friendly reminder that the implementation for this issue has been completed and submitted in PR #1433.

    Could you please review it when you get a chance? I'd be happy to address any feedback if needed.

    Thanks!

  18. github-actions commented on Jun 9, 2026

    @github-actions
    Contributor

    This issue has been unassigned from @deepsikha-dash due to 5 days of inactivity and is open for anyone to pick up — comment /assign to claim it!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions