You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setup for Browsershot 5.5 on a Forge server. Do the shared steps on every server, then follow either the normal-server path or the isolated-sites path.
Browsershot 5.5 launches Puppeteer's shell mode, so install chrome-headless-shell. A full Chrome install is a different binary and is not used.
Persisting Statamic Content Writes Across Zero-Downtime Deployments
Persisting Statamic Content Writes Across Zero-Downtime Deployments
The Problem
Zero-downtime deployments swap releases via a symlink. While a new release is being prepared, the old one keeps serving traffic. Any file Statamic writes during that window (content edits, form submissions, asset uploads) lands in the old release's directory.
This often surfaces as a push failure: error: failed to push some refs to '…'. Updates were rejected because the remote contains work that you do not have locally. The old release's local git history is behind origin (the new code has already shipped), yet it's still the place Statamic tries to commit and push from.
Shared paths (a common ZDD feature, called "Shared Paths" in Laravel Forge, "Linked Folders" in Envoyer, equivalents in Ploi and others) fix the data-loss part by storing the runtime-writable directories in one persistent location and symlinking them into each release. But because those paths are now symlinks, Statamic's git automation can't track them
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Learn how to use Livewire together with Statamic's static caching
How to use Livewire with Statamic static caching
Since Statamic 3.4.8
As of Statamic 3.4.8, Livewire works with Statamic's Half and Full Measure static caching without any additional configuration. This is due to the concept of replacers, which takes care of replacing Livewire's CSRF token.
Caveats
There is a catch, though. On the first page load, Statamic will cache the first render of the Livewire component. This can be an issue with components that display dynamic content like entries in random order. In this example, the order won't be random on subsequent page loads, but will always show in the order that it was first cached in.
If your component simply shows the latest articles in descending order, and you clear the cache whenever an entry is saved, you don't have to worry about this, though.
Valet Driver that supports Statamic 3's static caching
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters