question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] Support custom cache control

See original GitHub issue

Is your feature request related to a problem? Please describe.

Talking about rate limiter, it is better to have a customizable cache-control. E.g. I will use longer cache-control for repo card (extra pin). It is also helpful for people trying to avoid rate limiting.

Describe the solution you’d like

Add a parameter &cache_control=<maxage>. But the minimum maxage should retain 1800 to avoid abusement.

Additional context

Shields.IO has parameter ?cacheSeconds= support, and they are using 3600s as default cache-control.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

4reactions
anuraghazracommented, Jul 17, 2020

I like @filiptronicek’s suggestion to make the cache longer if the repo card has over 1k stars

2reactions
nombrekeffcommented, Jul 20, 2020

I like that idea @filiptronicek, Sound really reasonable. There is no need to update if the value it’s truncated

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom Caching Strategies - CacheControl - Read the Docs
A cache heuristic allows specifying a caching strategy by adjusting response headers before the response is considered for caching. For example, if we...
Read more >
Feature request: custom cache-control headers #567 - GitHub
Q: Why set a Cache-Control header at all for page requests – aren't they largely dynamic by nature (I'd be using sapper export...
Read more >
Cache-Control - HTTP - MDN Web Docs
The Cache-Control HTTP header field holds directives (instructions) — in both requests and responses — that control caching in browsers and ...
Read more >
What is Cache-Control and How HTTP Cache Headers Work
Cache -control is an HTTP header used to specify browser caching policies in both client requests and server responses. Policies include how a...
Read more >
Allow full cache control via HTTP headers
A simple change would be a custom HTTP header, which would tell Cloudflare how to cache this particular page. For example, it could...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found