Skip to content

Make caching on client side optional - #4940

Merged
ildyria merged 3 commits into
masterfrom
make-caching-client-side-optional
Nov 1, 2026
Merged

ildyria merged 3 commits into
masterfrom
make-caching-client-side-optional

Conversation

@ildyria

@ildyria ildyria commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features
    • Client-side API response caching can be enabled or disabled through configuration; it is enabled by default.
    • When disabled, the browser is asked not to reuse cached API responses, while thumbnail caching remains enabled.
    • Individual requests can still opt in to caching when the global setting is disabled.
    • The example configuration documents the setting.

@ildyria
ildyria requested a review from a team as a code owner November 1, 2026 21:07
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 54bf05b4-73dd-4e90-b5ae-64d6e5347d4a
Commits

Reviewing files that changed from the base of the PR and between 51e2f4a and 59ead10.

Files selected for processing: 1
  • resources/js/app.ts
Files skipped from review as they are similar to previous changes: 1
  • resources/js/app.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.

Walkthrough

The change adds a configurable client-cache setting, exposes it to the frontend through a meta tag, and configures Axios caching based on that setting. Thumbnail requests explicitly retain Axios caching.

Changes: Client Cache Configuration

Layer / File(s) Summary
Expose the client-cache setting
.env.example, config/features.php, app/View/Components/Meta.php, resources/views/components/meta.blade.php, tests/Feature_v3/ClientCache/ClientCacheMetaTest.php
The feature flag defaults to enabled and is exposed through a meta tag. Feature tests check the tag when the flag is enabled and disabled.
Configure frontend caching
resources/js/config/client-cache.ts, resources/js/config/axios-config.ts, resources/js/config/client-cache.test.ts, resources/js/app.ts, resources/js/app-v8.ts
The frontend reads the meta tag and configures the Axios cache interceptor. When caching is disabled, it adds no-cache request headers. Both app entry points now initialize Axios before mounting the app. Tests cover setting parsing and cache behavior.
Preserve thumbnail caching
resources/js/services/thumb-asset-service.ts, resources/js/services/thumb-asset-service.test.ts
Thumbnail requests explicitly enable Axios caching. A test checks the cache option on thumbnail requests.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: Low · up to 59ead

The feature test fails when client caching is disabled through the environment. Make the test independent of that override before merging, or accept the bounded test-suite failure.

Pre-merge checks: Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 11 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

A rabbit reads the cache setting with care
A meta tag carries the choice through the air
Axios follows the setting it sees
Thumbnails keep caching, steady as trees
Before the app mounts, setup is done
The rabbit hops off beneath the sun

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6062224d-b666-456e-9af6-d9d5841b2794
Commits

Reviewing files that changed from the base of the PR and between 654b32c and 5e7655d.

Files selected for processing: 10
  • .env.example
  • app/View/Components/Meta.php
  • config/features.php
  • resources/js/config/axios-config.ts
  • resources/js/config/client-cache.test.ts
  • resources/js/config/client-cache.ts
  • resources/js/services/thumb-asset-service.test.ts
  • resources/js/services/thumb-asset-service.ts
  • resources/views/components/meta.blade.php
  • tests/Feature_v3/ClientCache/ClientCacheMetaTest.php

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Comment thread resources/js/config/axios-config.ts Resolved
@codecov

codecov Bot commented Nov 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.32%. Comparing base (b5e2530) to head (59ead10).
⚠️ Report is 1 commits behind head on master.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ildyria
ildyria merged commit e3141fc into master Nov 1, 2026
58 checks passed
@ildyria
ildyria deleted the make-caching-client-side-optional branch November 1, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant