Adjust cache times based on various factors

Open
#46 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
php
Domain
api, backend

Research direction

Start by locating XRay's cache policy and URL-fetch entry point, then read the related tests. Compare how the issue expects cache duration to vary for tweets, Instagram posts, and other URLs, and consider how clients could request a fresh fetch. Done means the caching behavior and any refresh option have clear, testable semantics for these cases.

Written by the indexing model from the issue text.

Description

  • Tweets can't be edited, so they can be cached for a long time. (It's possible that Twitter may change their image CDN URLs so can't be infinite)
  • Instagram posts can be edited, but most of the time the older a photo is the less likely it is to be edited
  • Other URLs should be more conservative about being cached, since people sometimes use this for testing whether their markup changes are working, or it's used when verifying webmentions for updates. Could probably use similar logic to cache older posts longer.

Possibly give clients a way to force XRay to fetch the post if the client knows it may have been updated such as from a webmention update.

Dominant language
PHP
Stars
96
Forks
17
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aaronpk/XRay

All issues in aaronpk/XRay

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.