Skip to content

v0.11.0

Latest

Choose a tag to compare

@markvaneijk markvaneijk released this 04 Sep 17:55
c079a77

What's new

php artisan static:status

Nothing is ever removed from the static cache except by a full static:clear, and a file is written per URI including its query string. A cache that fills up a webserver is therefore usually not the pages themselves but their variants — every ?utm_source=… a bot or a newsletter hands out becomes its own file, forever.

This release adds a command that shows where the size actually sits, so the cause is visible before anything gets pruned:

  Files on disk ........................................................... 24
  Size on disk ........................................................ 1.7 MB
  Cached pages ............................... 17 (compressed copies excluded)
  Distinct URLs ........................................................... 11

   WARN  6 of 17 cached pages (35%) are extra query-string variants of 11 distinct URLs.

It reports:

  • storage held by URLs with vs without a query string
  • largest directories, cumulative (du-style, with pass-through levels collapsed)
  • top URLs by number of cached variants, and the most common query parameters
  • breakdown per host and per file type, where the multiplication from gzip/brotli siblings shows up
  • age distribution and largest single files
  • the config settings that govern cache growth, so the numbers and the levers are on one screen

When utm_source or fbclid tops the parameter table, static:clear --only-with-query-strings reclaims that space immediately.

Options: --disk=, --limit=, --json (machine-readable, for monitoring or a disk-usage alert).

Compressed siblings count towards size but not towards the page count, so enabling gzip never reads as cache growth. Memory scales with the number of distinct URL paths rather than files, so it stays usable on the multi-million-file caches it exists to diagnose. Only local disks can be inspected — walking a remote disk would be one API call per file.

Full Changelog: v0.10.0...v0.11.0