Improved
- Rebuilding the pages cache no longer writes a compiled file for every page, so the first request after a cache clear is much faster on large sites.
- A pages rebuild no longer loads a compiled file for every page into OPcache, so large sites stop pushing the rest of Grav's cached code out of memory.
- A pages rebuild reuses the page headers it read last time, so rebuilding after editing one page stays as quick as before.
- Checking whether pages changed now looks only at the page folders and files Grav already knows about instead of scanning the whole pages folder, which makes requests on large sites faster.
- Only one request at a time checks whether pages changed, and the others keep using the last result meanwhile.
- When the pages cache has to be rebuilt, one request rebuilds it and the others wait and use its result instead of all rebuilding at once.
- Saving or deleting a page through Grav now updates the pages cache on the next request instead of waiting for the change check, and plugins can do the same by calling
Pages::markChanged(). - That change notice is kept in a small file rather than the cache, so a page saved from the command line is picked up by the website even when the two use different cache drivers.
- A new
pages.frontmatter.native_yamlsetting reads page frontmatter with the much faster YAML extension when the server has it installed. It is off by default because the extension reads unquoted dates andyes/nodifferently. - Translations are now prepared one language at a time, when a request first needs that language, so the first request after a cache clear no longer reads every language that core and the plugins ship.
- Editing a language file now rebuilds only that language instead of every language.
- The pages cache is smaller because it no longer keeps a second, raw copy of every page's frontmatter.
- Listing every page, which the sitemap and
@page.descendantscollections do, is several times faster on large sites. - Page ETags are calculated with a much faster hash.
- Configuration and translation caches built by a request are loaded into OPcache after the response has been sent, instead of making that request wait.
- Rebuilding the pages cache after an edit no longer reads the pages and folders that did not change, so on large sites it takes about half the time it did before.
- With
pages.lazy_indexon, lists of pages such as menus, taxonomy pages,@page.descendantscollections and the sitemap load their pages in a few batches instead of one at a time. pages.lazy_indexnow defaults toauto, which uses the page index on sites with 1,000 pages or more and the classic pages cache on smaller ones, so large sites load pages faster and use far less memory without any setup.- Plugin classes load faster because Grav now asks only the plugin autoloaders that can have the class, in the same order as before.
- A modular page can set
cache_modules: trueto cache its modules' output, while modules with their own Twig or a form, logged-in visitors and form submissions are always rendered fresh. - A new
session.lazysetting, off by default, starts the session only when a visitor needs one, so anonymous page views can go out without a session cookie and be cached by a proxy or CDN. - CSS minification now uses wikimedia/minify, which understands modern CSS and is about 15 to 25 times faster on real stylesheets.
Bugfix
- Sites on Apache older than 2.4.8, common on Plesk and CentOS 7 hosts, no longer answer 500 for everything under
user/after upgrading, and upgrading fixes the.htaccessfiles earlier releases wrote there (grav-plugin-admin2#179) - Plugins'
onShutdownwork runs again after Admin Next saves on sites withsession.read_and_closeon, when another plugin had already finished the response. - Deleting or renaming a page folder is now picked up without clearing the cache.
- The
filechange check no longer counts files that only contain.mdsomewhere in their name, such aspage.md.bak, or whose name merely ends inyaml. - Searching Flex pages now matches a page's route as well as its title, slug and menu.
calc()inside@media,@supportsand@containerconditions keeps its spacing when CSS is minified, so browsers no longer drop those blocks.- A stylesheet with a quote that is never closed is now served unminified instead of losing the rules that follow it.