Roots Discourse

Sage 10 views caching question

Hello,

I am using Sage 10 and it appears I am required to run yarn clean:views to clear any cached views from within /storage/framework/views folder which is anti-productive as on each blade file I save I need to re-run this command.

can this clearing happen automatically or how do I disable this caching solution that sage 10 providers?

Thank you

It shouldn’t be necessary to re-run the command: Sage (usually) regenerates new cached files when the source blades change. If you find that you aren’t seeing the changes when you visit the site, then something isn’t working somewhere.

What could make Sage not detect blade changes?

Are there any troubleshooting steps I can take?

I’m not entirely sure. I’ve encountered similar problems a handful of times, but it was generally about a blade or two not updating all the time–never that all of them refused to update at all.

My understanding is that when your site is loaded and a view is requested, the Blade engine will determine at runtime if a file is different or not, and then update it. If that’s not happening my guess would be that something is interfering with that process, potentially something related to your filesystem. You haven’t provided any details as to your dev environment, but I’ve had some issues in the past with VMs and the boundary between the guest and host filesystems–specifically some virtualization systems have their own syncing mechanisms that can get confused/caught up/etc and not sync files between guest/host as they should, putting your in a situation where on the host your files seem to have changed, but those changes have been synced to the guest. Potentially there could be a permissions issue at play too (I’m not sure how, but permissions issues always crop up where you least expect them).

I would probably start troubleshooting by examining the files directly and seeing when and how they’re updated; if all of them fail to update or only some of them; if changes made directed to the rendered blades are reflected on the front-end or ignored; if changes made outside of your editor/IDE are respected or ignored; if changes made inside/outside of your guest are respected or ignored; etc.

Thank you for your descriptive reply.

I am using vagrant as the guest OS and have symlinked my Theme folder within the vagrant’s wp-content/themes folder.

I need to research on whether this could be a permission issue as occasionally I encounter such issues.

I will update if I find a solution.