-
Notifications
You must be signed in to change notification settings - Fork 701
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
Support static caching in Statamic #1440
Conversation
I'd be okay with (and prefer) that change (rename current one to V2, and let this V3 be the unversioned name) ... since I can't think of a logical case where anyone would have that filename hardcoded anywhere. |
Can do. |
Didn't realize there were tests for that - nice. Fixing those. |
Okay, done now. I've added tests and adjusted them so they all have appropriate fixtures corresponding to the renamed drivers. |
FWIW, in my testing I get the same results with either of these strategies: The one currently in this PR: + $drivers[] = 'Specific\StatamicValetDriver';
$drivers[] = 'LaravelValetDriver';
$drivers = array_unique(array_merge($drivers, $specificDrivers)); and the other idea suggested in the related issue: - $drivers[] = 'Specific\StatamicValetDriver';
- $drivers[] = 'LaravelValetDriver';
$drivers = array_unique(array_merge($drivers, $specificDrivers));
+ $drivers[] = 'LaravelValetDriver'; Each approach has its pros and cons:
In the end, I don't mind which approach we use here. I'm fine with the hardcoding of the Statamic driver, as committed already. |
Thanks. I'll write a test somewhere for the first/current change. I'd rather not move the Laravel driver in case it changes something. |
Totally understood. Will leave it to @mattstauffer to merge etc. |
Thanks @jasonvarga and @drbyte! |
Closes #1418
This PR adds a new driver for Statamic v3+.
Starting in v3, Statamic is just a Laravel package so we didn't have a need for a dedicated driver - the Laravel driver works fine. However as pointed out in #1418, our "static caching" feature wouldn't function 100% as expected locally because it assumes some custom server config. This driver "fakes" it.
In addition to the driver itself, it needs to be loaded before the Laravel driver. Otherwise, the Laravel driver will be used since a Statamic site also qualifies as a Laravel site.
Lastly, @aerni mentioned in the issue that we should call this driver "Statamic" and the previous one "StatamicV2" - I agree but it would be a breaking change. Not a big deal.