Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[youtube][playlist]: Implement playlist data caching and manual refresh button #10

Open
1 task done
DarhkVoyd opened this issue Oct 8, 2023 · 0 comments
Open
1 task done
Labels
Status: Available Ready to be taken up for work or review Type: Enhancement New feature or request

Comments

@DarhkVoyd
Copy link
Member

Issue Type

  • Feature Request

Description

Currently, every time a user visits a playlist page, a fresh API call is made to fetch playlist data, even if they've recently visited the same playlist. This can be resource-intensive and unnecessary, especially since playlists are not frequently updated.

We aim to optimize this behavior by implementing browser caching using local storage. The idea is to store playlist data in the browser's local storage for a specified duration, so that subsequent visits to the same playlist within that timeframe can use the cached data instead of making a new API call.

Additionally, we want to provide users with the option to force a fresh API call if they believe the playlist has been updated or want to refresh the data manually. To achieve this, we'll add a button in the playlist section that allows users to trigger a new API call.

Expected Behavior

  • Implement browser caching for playlist data using local storage.
  • Cached data should expire after a set time period (configurable).
  • Add a button in the playlist section that enables users to force a fresh API call when needed.

Current Behavior

Currently, each visit to a playlist page results in a new API call, regardless of whether the data has been recently fetched.

Suggested Implementation

  • Utilize the browser's local storage to cache playlist data.
  • Implement logic to expire cached data after a configurable time period.
  • Add a user interface element (e.g., a button) in the playlist section to allow manual refresh of the data.

Additional Context

This optimization aims to reduce unnecessary API calls to our backend, improving resource efficiency and enhancing user experience. It also aligns with best practices for handling frequently accessed data.

@DarhkVoyd DarhkVoyd added Type: Enhancement New feature or request Status: Available Ready to be taken up for work or review WebApp-YouTube labels Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Available Ready to be taken up for work or review Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant