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
While using php artisan statamic:stache:warm on a fairly large repository of ours I noticed one odd or two odd things. Note that I ran into this because I'm debugging awfully slow rendering/caching times, talking 10 seconds plus.
The first thing is that there are 2740 queries (Debugbar) on the first page visit when nothing is cached. Those each take around 20μs but there also hundreds of select * from entries where id = ? queries that take 200μs to 250μs but no biggie, those will only be executed once and we can use php artisan statamic:stache:warm to get warmed up and avoid that they pop up. That's where we noticed something odd and we basically have 2 scenarios in which we can reproduce this:
We visit the page without php artisan statamic:stache:warm and see the 2740 queries with a total render time of 11s. On the second visit we only see 125 queries with a total render time of 1s. This is what we would expect since the 2740 queries moved some things into the stache.
We run php artisan statamic:stache:warm and then visit the page in hopes of only encountering the 125 queries. We are still seeing 1154 queries with a render time of 6s. On the second visit we only see 125 queries with a total render time of 1s. This was a bit unexpected since we were hoping that php artisan statamic:stache:warm would eliminate all of those queries.
Is there some obvious reason for the difference in how those queries are cached by visiting the page vs. using php artisan statamic:stache:warm in that case? We are seeing 8-14 seconds caching times per page when deploying and after adding some logging we noticed that php artisan statamic:stache:warm not warming everything is part of the problem.
Have a repository with 6 sites and 1200+ pages. I can't provide a reproduction repository due to it being private but could invite a team member to it.
Could this be caused by the order of the console commands?
Running statamic:static:warm before statamic:stache:refresh might lead to the first requests being fired before the stache has been rebuilt. On large sites, rebuilding the stache takes quite long, so there might be some advantage to switching those around.
The issue can be reproduced by clearing everything and just running php artisan statamic:stache:warm so for reproduction purposes that shouldn't matter.
Bug description
While using
php artisan statamic:stache:warm
on a fairly large repository of ours I noticed one odd or two odd things. Note that I ran into this because I'm debugging awfully slow rendering/caching times, talking 10 seconds plus.The first thing is that there are 2740 queries (Debugbar) on the first page visit when nothing is cached. Those each take around 20μs but there also hundreds of
select * from entries where id = ?
queries that take 200μs to 250μs but no biggie, those will only be executed once and we can usephp artisan statamic:stache:warm
to get warmed up and avoid that they pop up. That's where we noticed something odd and we basically have 2 scenarios in which we can reproduce this:php artisan statamic:stache:warm
and see the 2740 queries with a total render time of 11s. On the second visit we only see 125 queries with a total render time of 1s. This is what we would expect since the 2740 queries moved some things into the stache.php artisan statamic:stache:warm
and then visit the page in hopes of only encountering the 125 queries. We are still seeing 1154 queries with a render time of 6s. On the second visit we only see 125 queries with a total render time of 1s. This was a bit unexpected since we were hoping thatphp artisan statamic:stache:warm
would eliminate all of those queries.Is there some obvious reason for the difference in how those queries are cached by visiting the page vs. using
php artisan statamic:stache:warm
in that case? We are seeing 8-14 seconds caching times per page when deploying and after adding some logging we noticed thatphp artisan statamic:stache:warm
not warming everything is part of the problem.How to reproduce
Have a repository with 6 sites and 1200+ pages. I can't provide a reproduction repository due to it being private but could invite a team member to it.
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
The text was updated successfully, but these errors were encountered: