Skip to content

Configuration ​

config/inertia-static.php (publish with php artisan vendor:publish --tag=inertia-static-config).

General ​

KeyEnvDefault
enabledINERTIA_STATIC_ENABLEDtrueKill switch: every route behaves as dynamic and purges are skipped.
base_urlINERTIA_STATIC_BASE_URLAPP_URLOrigin of every absolute URL (purge, warmup, canonical redirects).
inertia_middleware—App\Http\Middleware\HandleInertiaRequestsUsed to resolve the asset version outside HTTP requests (queues, commands).
json.prefix—__inertiaPrefix of the page JSON, live, manifest and CSRF URLs.
json.index—indexJSON name of the root page (/__inertia/{version}/index.json).
json.live_middleware—EncryptCookies, StartSessionMiddleware of the never-cached live URL, so it can return validation errors and Inertia flash data to forms submitted from static pages.
strip_middleware—session, cookie and CSRF middlewareRemoved from static routes. Classes that do not exist are ignored.
public_shared_props—[]Shared props kept on static routes.
cache_headerINERTIA_STATIC_CACHE_HEADERX-Inertia-Static-Cachecacheable / bypass header for CDN rules; empty disables it.
debug_headerINERTIA_STATIC_DEBUG_HEADERX-Inertia-StaticMISS on cacheable responses; {header}-Reason explains the others; empty disables both.
implicit_tags—trueTag every cached page with its path prefixes (_IST_/, _IST_/blog/, …).

Leak detector ​

KeyEnvDefault
leak_detector.modeINERTIA_STATIC_LEAK_DETECTORnullthrow, auto or log; null = throw in throw_in environments, auto elsewhere.
leak_detector.storeINERTIA_STATIC_DOWNGRADES_STOREdefault cache storeWhere auto mode remembers the routes it turned dynamic.
leak_detector.throw_in—['local', 'testing']
leak_detector.log_channelINERTIA_STATIC_LOG_CHANNELdefault channel

SSR, CSRF and props ​

KeyEnvDefault
ssr.requiredINERTIA_STATIC_SSR_REQUIREDfalsetrue: when Inertia SSR is enabled, an HTML page rendered without it (SSR server down) is sent with no-store instead of being cached.
csrf_cookieINERTIA_STATIC_CSRF_COOKIEnulltrue: the client fetches the CSRF cookie from /__inertia/csrf before the first form submission. null: only on Laravel 12.
deferred_propsINERTIA_STATIC_DEFERRED_PROPSthrowthrow or allow deferred props on static pages.

Preview mode ​

KeyDefault
preview.cookieinertia_static_previewName of the preview cookie.
preview.minutes60Default lifetime of StaticCache::enablePreview().

Cache policy defaults ​

KeyDefault
defaults.revalidate3600Edge TTL (seconds).
defaults.expire31536000How long a page may be served stale while it is regenerated: stale-while-revalidate = expire - revalidate.
defaults.stale_while_revalidatenullExplicit value; overrides expire.
defaults.stale_if_error604800
defaults.browser_cache_controlpublic, max-age=0, must-revalidateBrowsers always revalidate (cheap 304s).
defaults.not_found_ttl60TTL of cached 404s.
defaults.cache_redirectsfalseCache redirects returned by your code (canonical redirects are always cached).
defaults.redirect_ttl300TTL of cached redirects.

Normalization ​

KeyDefault
normalization.enabledtrueRedirect non-canonical URLs.
normalization.trailing_slashnevernever, always, ignore.
normalization.strip_queryutm_*, fbclid, gclid, gbraid, wbraid, msclkid, mc_cid, mc_eid, _ga, refAlways removed, even when whitelisted (wildcards allowed).

CDN ​

KeyEnvDefault
cdnINERTIA_STATIC_CDNnull
drivers.cloudflare.zone_id / api_tokenCLOUDFLARE_ZONE_ID / CLOUDFLARE_API_TOKEN—
drivers.cloudflare.batch_sizeCLOUDFLARE_PURGE_BATCH_SIZE100
drivers.cloudflare.hosts—the base_url host (hostnames purged by "purge all")
drivers.cloudflare.purge_everythingCLOUDFLARE_PURGE_EVERYTHINGfalse (purge the whole zone on "purge all")
drivers.fastly.service_id / api_tokenFASTLY_SERVICE_ID / FASTLY_API_TOKEN—
drivers.bunny.pull_zone_id / api_keyBUNNY_PULL_ZONE_ID / BUNNY_API_KEY—
drivers.bunny.native_tags—false (tag purges go through the tag registry)
drivers.cloudfront.distribution_idCLOUDFRONT_DISTRIBUTION_ID—
drivers.cloudfront.key / secret / tokenAWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKEN—
drivers.cloudfront.staleCLOUDFRONT_STALEfalse
drivers.varnish.hostsVARNISH_HOSTS (comma separated)http://127.0.0.1:6081
drivers.varnish.tag_header—xkey
drivers.nginx.hostsNGINX_CACHE_HOSTS (comma separated)http://127.0.0.1
drivers.nginx.purge_path—/purge
drivers.multi.drivers—['varnish', 'cloudflare']

Drivers: null, cloudflare, fastly, bunny, cloudfront, varnish, nginx, multi, or your own (StaticCache::extend()). Every driver also accepts timeout (default 15) and connect_timeout (default 5).

Tag registry ​

KeyEnvDefault
registry.driverINERTIA_STATIC_REGISTRYnulldatabase, cache or null (disabled).
registry.table—inertia_static_tags
registry.connection—defaultDatabase connection.
registry.store—defaultCache store (e.g. redis).
registry.max_urls_per_tagINERTIA_STATIC_REGISTRY_MAX_URLS1000URLs kept per tag. Past it, a tag purge on a CDN without tag purges purges the whole cache. null: no limit.

Purging ​

KeyEnvDefault
purge.queueINERTIA_STATIC_PURGE_QUEUEdefault
purge.connectionINERTIA_STATIC_PURGE_CONNECTIONdefault
purge.debounceINERTIA_STATIC_PURGE_DEBOUNCE5Delay and uniqueness window (seconds).
purge.modeINERTIA_STATIC_PURGE_MODEsoftsoft (mark stale) or hard (remove now). CDNs without soft purges always purge hard.
purge.tries—5Max exceptions before the job fails.
purge.backoff—[5, 30, 120]
purge.rate_limit_per_minuteINERTIA_STATIC_PURGE_RATE_LIMIT60Cloudflare Free: 5.
purge.warm_after_purge—falseRe-request purged URLs.
purge.warm_urlINERTIA_STATIC_WARM_URLnullAddress used to reach the CDN for warmups (the public Host is kept).

Released under the MIT License.