Skip to content

feat: disable cache with proper headers when CACHE_SECONDS env is zero - #4539

Merged
qwerty541 merged 2 commits into
anuraghazra:masterfrom
qwerty541:feat_disable_cache_when_cache_seconds_env_less_than_one
Oct 7, 2025
Merged

feat: disable cache with proper headers when CACHE_SECONDS env is zero#4539
qwerty541 merged 2 commits into
anuraghazra:masterfrom
qwerty541:feat_disable_cache_when_cache_seconds_env_less_than_one

Conversation

@opheliagoldstein

Copy link
Copy Markdown
Contributor

No description provided.

@vercel

vercel Bot commented Oct 7, 2025

Copy link
Copy Markdown

@qwerty541 is attempting to deploy a commit to the github readme stats Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the stats-card Feature, Enhancement, Fixes related to stats the stats card. label Oct 7, 2025

@opheliagoldstein opheliagoldstein left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️

@qwerty541
qwerty541 requested a review from Copilot October 7, 2025 22:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds functionality to disable caching when the CACHE_SECONDS environment variable is set to zero, implementing proper cache-busting headers for better cache control.

  • Refactored cache seconds resolution logic to handle zero values properly
  • Added a new disableCaching function that sets appropriate no-cache headers
  • Updated both normal and error cache handling to respect zero cache seconds
  • Added comprehensive test coverage for the new caching behavior

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/api.test.js Added test setup and new test cases for cache behavior with CACHE_SECONDS environment variable
src/common/cache.js Implemented cache disabling logic and updated cache header functions to handle zero cache seconds

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/common/cache.js Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@qwerty541
qwerty541 merged commit e8e5cf8 into anuraghazra:master Oct 7, 2025
6 of 7 checks passed
@qwerty541
qwerty541 deleted the feat_disable_cache_when_cache_seconds_env_less_than_one branch October 7, 2025 22:19
harryzcy pushed a commit to harryzcy/github-readme-stats that referenced this pull request Oct 15, 2025
anuraghazra#4539)

* feat: disable cache with proper headers when CACHE_SECONDS env is zero

* Update src/common/cache.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
martin-mfg pushed a commit to stats-organization/github-stats-extended that referenced this pull request Nov 2, 2025
anuraghazra#4539)

* feat: disable cache with proper headers when CACHE_SECONDS env is zero

* Update src/common/cache.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
ghosind pushed a commit to ghosind/github-readme-stats that referenced this pull request Dec 30, 2025
anuraghazra#4539)

* feat: disable cache with proper headers when CACHE_SECONDS env is zero

* Update src/common/cache.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
zimya pushed a commit to zimya/github-readme-stats-cf that referenced this pull request Jan 13, 2026
anuraghazra#4539)

* feat: disable cache with proper headers when CACHE_SECONDS env is zero

* Update src/common/cache.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
piscis pushed a commit to piscis/github-readme-stats that referenced this pull request Feb 7, 2026
anuraghazra#4539)

* feat: disable cache with proper headers when CACHE_SECONDS env is zero

* Update src/common/cache.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
zntb added a commit to zntb/github-readme-stats that referenced this pull request Jul 27, 2026
anuraghazra#4539)

* feat: disable cache with proper headers when CACHE_SECONDS env is zero

* Update src/common/cache.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
zntb added a commit to zntb/github-readme-stats that referenced this pull request Jul 27, 2026
anuraghazra#4539)

* feat: disable cache with proper headers when CACHE_SECONDS env is zero

* Update src/common/cache.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stats-card Feature, Enhancement, Fixes related to stats the stats card.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants