Disable response caching functionality#4362
Conversation
Agent-Logs-Url: https://github.com/LycheeOrg/Lychee/sessions/4c34b7fe-2ea3-4eab-a180-959e1d316b8f Co-authored-by: ildyria <627094+ildyria@users.noreply.github.com>
… spec/plan/tasks Agent-Logs-Url: https://github.com/LycheeOrg/Lychee/sessions/bd357fb4-647a-4a7b-bc4a-38714d272525 Co-authored-by: ildyria <627094+ildyria@users.noreply.github.com>
…s unless ENABLE_REQUEST_CACHING=true Agent-Logs-Url: https://github.com/LycheeOrg/Lychee/sessions/51590a10-1fec-4bed-9a18-05bc95f57399 Co-authored-by: ildyria <627094+ildyria@users.noreply.github.com>
📝 WalkthroughWalkthroughThis pull request implements Feature 040 to disable request caching by default. It introduces a one-way migration forcing ChangesFeature 040: Disable Request Caching
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ❌ 1❌ Failed checks (1 warning)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
docs/specs/4-architecture/features/040-disable-request-caching/tasks.md (1)
102-109:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd the required documentation footer at the bottom of this file.
tasks.mdis missing the required trailing---and*Last updated: [date]*footer block.As per coding guidelines, "At the bottom of documentation files, add an hr line followed by 'Last updated: [date of the update]'."
docs/specs/_current-session.md (1)
64-69:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd the required bottom “Last updated” footer.
After Line 69, the file should end with the required footer format (
---+*Last updated: [date]*) at the bottom.Suggested doc fix
--- **Session Context for Handoff:** Feature 040 spec, plan, and tasks are complete (9 tasks across 5 increments, all ≤40 min, tests-before-code). No open questions. Next author to pick up: run the analysis gate, then begin T-040-01 (migration to force `cache_enabled = '0'`). All increments are sequential with no blocking dependencies. + +--- + +*Last updated: 2026-05-18*As per coding guidelines, "At the bottom of documentation files, add an hr line followed by 'Last updated: [date of the update]'".
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8de837d1-9e64-4f3b-8d06-9a55a154c6c3
📒 Files selected for processing (10)
.env.exampleapp/Http/Controllers/Admin/SettingsController.phpconfig/features.phpdatabase/migrations/2026_05_18_000001_disable_request_caching.phpdocs/specs/4-architecture/features/040-disable-request-caching/plan.mddocs/specs/4-architecture/features/040-disable-request-caching/spec.mddocs/specs/4-architecture/features/040-disable-request-caching/tasks.mddocs/specs/4-architecture/roadmap.mddocs/specs/_current-session.mdtests/Feature_v2/Settings/GetAllSettingsTest.php
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
Response caching is a footgun when password-protected albums are in use. This makes it opt-in via an env flag and ensures the settings UI reflects that state without any frontend-specific changes.
Backend
2026_05_18_000001_disable_request_caching.php— forcescache_enabled = '0'in existing installations.down()is a no-op (previous value is unknown).config/features.php— newenable-request-cachingflag sourced fromENABLE_REQUEST_CACHINGenv var, defaulting tofalse.SettingsController::getAll— filters out the entireMod Cachecategory when the flag is off, mirroring the existinghide-lychee-SEpattern:.env.example— documentsENABLE_REQUEST_CACHING=false.Frontend (no changes required)
General.vuealready guards the cache toggle withv-if="cache_enabled !== undefined". Theload()function populatescache_enabledviaconfigurations.find(config => config.key === 'cache_enabled'). When the API omitsMod Cache, the ref staysundefinedand the toggle does not render — noInitConfigorLycheeStateStorechanges needed.Tests
Two new cases in
GetAllSettingsTest: assertMod Cacheis absent from the response by default, and present whenconfig(['features.enable-request-caching' => true])is forced.Summary by CodeRabbit