Sage 9 Blade Cache

So my team and I are working on a new version of our wordpress theme and we decided to use Sage 9 as a starting place. We aren’t doing anything too crazy, just a simple ACF page builder that we use a lot.

We are running into a problem with the way Sage 9 is caching the blade files. We are running our local environment with Lando since we use Pantheon as our hosting.

I’m not sure if it is Lando caching the wrong/old view files or if we have improperly setup our compiling process but when we are doing development on the views and controller files the only way to get the changes on the wordpress side to notice the new view files is by completely shutting down our instance of Lando and starting it back up again.

I’ve poured over the previous threads about the blade cache and the various solutions some people have tried.

Thought I had fixed it by installing the alwaysblank/blade-generate and clearing the cache but it seems the views are being stored elsewhere?

Any guidance would be appreciated as I’m new on this forum.

Thanks!

blade-generate hooks into the view pipeline and deletes the files that Blade generates very specifically. If they’re being stored elsewhere, then that’s in addition to what Blade does. I’m not familiar w/ Lando, but it sounds like it’s doing some local caching that is sitting “on top” of Blade’s templates. It looks like Lando uses memcached so you may be able to disable or configure that: https://docs.devwithlando.io/services/memcached.html

I’m loving the fact that Chewbacca is

5 Likes

After Cloud City I’m pretty surprised Chewie would trust him with something like that.

3 Likes

Ah yes I was hoping someone would put the two together! Felt only right considering how much Lando this and Lando that I was going to be posting about :+1:

@alwaysblank turns out you were right my friend, caching was happening with the Lando wordpress recipe.

I went ahead and got Trellis running with Vagrant and now I finally see how the theme and caching are supposed to work! Very convenient, I change a blade or file in app/ and refresh and there it is right away.

Now I just need to figure out how to do a custom recipe with Lando. Might just end up using Trellis instead and deploying to Pantheon another way.

Thanks for your help!