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
I have had positive results using the Laravel Octane Cache Driver to generate our large Statamic project with statamic/ssg. Our project is generated about 80% faster with CACHE_DRIVER: octane.
I am aware that Swoole is not supported with Statamic (and possibly never will). However, it would be an interesting approach to at least speed up ssg with it. During my tests, it turned out that the build works in principle, but unfortunately, it leads to problems in some special cases with some Antlers Tag params.
In one scenario with enabled CACHE_DRIVER: octane when one of my templates uses collection Tag in combination with select parameter, during ssg this overrides the variable scope for some other entries being generated.
Perhaps @JohnathonKoster could take a look at this and see if this is really related to Antlers. If this issue is not related to Antlers and cannot be resolved without making bigger changes to Statamic Core, that would be unfortunate. However, I do not want to give up on this approach too fast, as it shows great potential to speed up things on larger projects. :)
This discussion is only about ssg, I'm not planning to use octane cache driver for other use cases, like using the control panel, serving the site etc. since this is techically not possible yet.
Just run docker compose up in my test repos root to generate a static build. You'll find all files inside storage/app/static.
Result
Some generated pages are not having any title / content values.
The workaround is removing the select param from {{ collection from="pages" as="posts" select="permalink" }}. When removing the param the build created by ssg contains all expected values.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have had positive results using the Laravel Octane Cache Driver to generate our large Statamic project with statamic/ssg. Our project is generated about 80% faster with
CACHE_DRIVER: octane
.I am aware that Swoole is not supported with Statamic (and possibly never will). However, it would be an interesting approach to at least speed up ssg with it. During my tests, it turned out that the build works in principle, but unfortunately, it leads to problems in some special cases with some Antlers Tag params.
In one scenario with enabled
CACHE_DRIVER: octane
when one of my templates usescollection
Tag in combination withselect
parameter, during ssg this overrides the variable scope for some other entries being generated.Perhaps @JohnathonKoster could take a look at this and see if this is really related to Antlers. If this issue is not related to Antlers and cannot be resolved without making bigger changes to Statamic Core, that would be unfortunate. However, I do not want to give up on this approach too fast, as it shows great potential to speed up things on larger projects. :)
This discussion is only about ssg, I'm not planning to use octane cache driver for other use cases, like using the control panel, serving the site etc. since this is techically not possible yet.
How to reproduce
Setup
swoole
support."laravel/octane"
to Statamic.CACHE_DRIVER: octane
in .envpages
collection with 500 dummy entries. An entry contains randomtitle
andcontent
.web.php
which renderssitemap.antlers.html
to a filesitemap.xml
:Just run
docker compose up
in my test repos root to generate a static build. You'll find all files insidestorage/app/static
.Result
Some generated pages are not having any
title
/content
values.The workaround is removing the
select
param from{{ collection from="pages" as="posts" select="permalink" }}
. When removing the param the build created byssg
contains all expected values.Beta Was this translation helpful? Give feedback.
All reactions