On Dec 22, 2024, at 10:57 AM, Kévin Dunglas <[email protected]> wrote:
>
> On Sun, Dec 22, 2024 at 10:44 AM Jakub Zelenka <[email protected]> wrote:
> Thinking about it, there might be a possibility to address it (at least on Linux) using
> fanotify. Not sure about other platforms but maybe there are some solutions to address it. Also it
> might get a bit complex and not sure how much the solution is viable.
>
> For FrankenPHP, we successfully use https://github.com/e-dant/watcher for this kind of
> usage. It supports Linux (fanotify, notify, epoll...), macOS, and Windows, and is very efficient.
> It's a C++ library but with pure C bindings.
>
> Best,
I think watching files makes sense for FrankenPHP's use case of
development server, but I can't imagine the overhead and
non-portability makes sense for the stat cache. I feel any gains you'd
have from stat cache would be offset by that. And it'd be unfortunately
the only way to actually solve the "external thing changes thing behind
the stat cache's back" problem.