Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gregjones/httpcache
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: slashid/httpcache
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 6 commits
  • 13 files changed
  • 2 contributors

Commits on Apr 20, 2023

  1. Support stale-while-revalidate

    stale-while-revalidate allows resources that are accessed often to be refreshed asynchronously.
    
    This is implemented by a new freshness state that returns the cached response, but triggers an asynchronous request that gets stored in the cache.
    
    ## Example
    
    If we need to call an external service to generate short-lived user JWT tokens (e.g., valid for a minute)
    
    Imagine this request is slow and needs to be cached so the app is more responsive. However I we don't want the app to hang every minute when the JWT token expires, so it needs to be refreshed asynchronously.
    
    Instead of returning `cache-control: max-age=60`, it can now return `cache-control: max-age=30, stale-while-revalidate=30`, so that JWT tokens for users making frequent requests are regenerated every ~30s.
    
    (If the user stays away for over a minute the next request will be slower)
    paulo-raca committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    03526f4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    48d350d View commit details
    Browse the repository at this point in the history
  3. Add go.mod

    paulo-raca committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    3e59e3b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ea496e7 View commit details
    Browse the repository at this point in the history

Commits on Apr 21, 2023

  1. Merge pull request #1 from slashid/gomod

    Add go.mod, rename package
    balenio authored Apr 21, 2023
    Configuration menu
    Copy the full SHA
    9905749 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #2 from slashid/stale-while-revalidate

    Stale while revalidate
    balenio authored Apr 21, 2023
    Configuration menu
    Copy the full SHA
    f026b4e View commit details
    Browse the repository at this point in the history
Loading