Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command to warm the static cache #3745

Closed
wants to merge 35 commits into from
Closed

Command to warm the static cache #3745

wants to merge 35 commits into from

Conversation

edalzell
Copy link
Contributor

Took this from @robdekort's Peak Starter Kit. Believe he got it from Jason.

This warms the static cache by visiting all the entry pages.

At the moment, it does not do taxonomy pages, nor custom routes, though those could be added.

It currently uses the HTTP Client's Pool ability to run the requests concurrently. This is part of Laravel 8 only, but if this PR would be accepted, I'll update to either handle the concurrency differently or not do it on Laravel < 8.

@edalzell edalzell marked this pull request as draft May 20, 2021 04:35
@edalzell
Copy link
Contributor Author

@jasonvarga is this likely to get accepted? If so, I'll tidy up to not do the concurrency on Laravel < 8 and make some tests.

@edalzell
Copy link
Contributor Author

edalzell commented May 20, 2021

Note to self, version check would look like version_compare(Application::VERSION, '8.37.0', '>=')

Spatie's fork package supports all of Laravel 8, might be better.

@robdekort
Copy link
Contributor

FWIW I remember Jason saying he'd love this in core when it also does taxonomies and custom routes.

@jasonvarga
Copy link
Member

I'd be fine with this, even if it's only supported on Laravel 8.

@edalzell
Copy link
Contributor Author

Note to self, copy the url generation from the SSG: https://github.com/statamic/ssg/blob/f723c48e3d27535be73c1b4e225f653981d6459e/src/Generator.php#L203

dependabot bot and others added 23 commits May 20, 2021 11:28
Bumps [underscore](https://github.com/jashkenas/underscore) from 1.9.2 to 1.12.1.
- [Release notes](https://github.com/jashkenas/underscore/releases)
- [Commits](jashkenas/underscore@1.9.2...1.12.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@jasonvarga
Copy link
Member

You mentioned to me that you'd open a new PR that doesn't have the merge mess. I'm closing this and look forward to the new version. 😄

I'm definitely okay with this being a Laravel 8 only feature, like what we did with default passwords. You could just throw an exception and say sorry.

@jasonvarga jasonvarga closed this Jun 21, 2021
@edalzell edalzell deleted the feature/warm-static-cache branch August 3, 2021 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet