Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Samizdat
Samizdat
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 29
    • Issues 29
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 13
    • Merge Requests 13
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • libre
  • SamizdatSamizdat
  • Issues
  • #16

Closed
Open
Created Oct 19, 2019 by Aleksandar Todorović@aleksandarOwner2 of 2 tasks completed2/2 tasks

Implement caching using the Cache API

Cache API seems like a great fit and a decent fix for #3. It could easily-ish be implemented as a Samizdat plugin. Global changes that would need to be implemented are:

  • make sure plugins are actually run one after another (right now it's only the first registered plugin that is used)
  • make sure the stash() method of a SamizdatPlugin can be registered to be run always after a successful fetch()

Once these are done, the cache plugin could be set-up to handle fetch() after the gun+ipfs in case of error, and automagically stash() new content to local cache in case of content being successfully fetched via HTTPS or gun+ifps.

Eventually cache.fetch() could be run before any other plugins to display cached content while newer stuff is being fetched, but that would require additional changes in how we deal with things (namely, we would need to be able to re-fetch content that has already successfully been "fetched" by the cache plugin). This would probably require some magic outside the service worker itself ("oh, this content was fetched using cache plugin, let's try re-fetching it using any other method").

Edited Nov 11, 2019 by Aleksandar Todorović
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None