Skip to content

Add configurable asset cache lifetime per proxy host - #5815

Open
RentnerKev wants to merge 1 commit into
NginxProxyManager:developfrom
RentnerKev:rentner/proxy-host-asset-cache-ttl
Open

Add configurable asset cache lifetime per proxy host#5815
RentnerKev wants to merge 1 commit into
NginxProxyManager:developfrom
RentnerKev:rentner/proxy-host-asset-cache-ttl

Conversation

@RentnerKev

@RentnerKev RentnerKev commented Aug 30, 2026

Copy link
Copy Markdown

Why

Issue #5448 requests configurable asset cache lifetimes without manual Advanced configuration directives.

This is the asset-caching portion of #5803, split out following the maintainer's request. It targets develop independently and does not include gzip or HTTP/3 controls. It addresses the caching part of #5448; the gzip part is submitted separately in #5816. The HTTP/3 portion is in #5817.

What Changed

  • Add the optional API field asset_cache_ttl, with a database default of 1800 seconds and validation from 1 to 31536000 seconds.
  • Show the lifetime field only when Cache Assets is enabled.
  • Apply the configured lifetime to both the main host and custom locations.
  • Extract shared asset proxy directives while keeping the existing static assets.conf include available.
  • Include a dedicated migration, OpenAPI definitions/examples, translations, and focused backend, frontend, and API tests.

Existing API clients can omit the new field. There are no removed or renamed fields, and no HTTP/3 listener, port, or gzip changes.

Validation

  • Backend tests: 5 passed; full frontend suite: 11 passed.
  • Backend/frontend lint, OpenAPI validation, locale compilation, TypeScript, and production frontend build passed.
  • Fresh isolated Linux/SQLite setup: all 20 migrations passed; persisted defaults and absence of unrelated feature columns verified.
  • SQLite upgrade/rollback checks verified defaults, saved values, and removal of only this feature's column.
  • Real Nginx configuration and HTTP checks passed for regular/custom locations, 1800/21600/31536000-second lifetimes, and disabled caching.
  • Feature-specific Cypress API scenarios are included; the full Cypress CI stack was not rerun locally.

The Windows frontend test run used NODE_OPTIONS=--no-experimental-webstorage with Node 26. The runtime checks used the project's nginxproxymanager/nginx-full:certbot-node image with Node 22.

A temporary combined checkout of all three split changes also passed 13 backend tests, 13 frontend tests, the frontend build, all 22 migrations, and the Nginx runtime checks after resolving the shared insertion points.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • API changes
  • Performance improvement
  • Test addition or update

AI Usage

  • AI was used to write this
  • AI was used to review this

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