Skip to content

fix: disable homepage caching in local development environment #12335

Merged
RayBB merged 1 commit intointernetarchive:masterfrom
KrishnaShuk:fix-12324-local-homepage-cache
Apr 9, 2026
Merged

fix: disable homepage caching in local development environment #12335
RayBB merged 1 commit intointernetarchive:masterfrom
KrishnaShuk:fix-12324-local-homepage-cache

Conversation

@KrishnaShuk
Copy link
Copy Markdown
Contributor

Closes #12324

Fix

Disables the 5-minute homepage Memcache in local dev environments so template changes reflect instantly upon refresh.

Technical

Conditionally bypasses get_cached_homepage() in home.py when the "dev" feature flag is detected.

Testing

  1. Modify any string in templates/home/index.html.
  2. Refresh the homepage; changes should appear immediately without a container restart.

Screenshot

N/A

Stakeholders

@RayBB

@mekarpeles
Copy link
Copy Markdown
Member

Thank you for this contribution, @KrishnaShuk!

🤖 Copilot has been assigned for an initial review.

@RayBB is assigned to this PR and currently has:

  • 2 open PR(s) of equal or higher priority to review first
PR triage checklist (maintainers / Pam)
  • PR description — not empty; explains what the change does and how to verify it
  • References an issue — PR body contains a #NNN reference
    • Linked issue is triaged — has a Priority: * label (not just Needs: Triage)
    • Linked issue is assigned — has at least one assignee
  • Commit history clean — no WIP/fixup/conflict noise; commit messages are meaningful
  • CI passing — no failing check-runs
  • Test cases present — if the change touches substantive logic, test coverage exists or is explained
  • Proof of testing — PR body includes a description of what was tested, a screenshot, or a video

Note

This comment was automatically generated by Pam, Open Library's Project AI Manager, on behalf of @mekarpeles. Pam is designed to provide status visibility, perform basic project management functions and relevant codebase research, and provide actionable feedback so contributors aren't left waiting.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Disables homepage memcache caching in local development ("dev" feature flag) so homepage template/content changes show up immediately on refresh, while keeping the existing 5-minute caching behavior for non-dev environments.

Changes:

  • In home.GET(), bypasses get_cached_homepage() when "dev" in web.ctx.features and calls get_homepage() directly.
  • Keeps the existing cached homepage path unchanged for non-dev environments.

Copy link
Copy Markdown
Collaborator

@RayBB RayBB left a comment

Choose a reason for hiding this comment

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

Very good job on this one! Good eye catching that we need to specify dev mode and you used modern python syntax 👍

@RayBB RayBB merged commit 459b33a into internetarchive:master Apr 9, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from Waiting Review/Merge from Staff to Done in Ray's Project Apr 9, 2026
@KrishnaShuk KrishnaShuk deleted the fix-12324-local-homepage-cache branch April 10, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Disable homepage caching in local development environment

4 participants