$vendorViews
Resolution Leading to Duplicate View Cache Files
#170
Unanswered
peterjbassi
asked this question in
Q&A
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
We're noticing some duplication of files in Laravel's view cache (
./storage/framework/views
) for some packages on requests that come in well afterphp artisan view:cache
has been run.An example is in Filament Charts. The resolved paths from
php artisan view:cache
andlaravel-package-tools
are "different", so the hashes used to the name the cache files are different. This ultimately results in the file cached throughphp artisan view:cache
being ignored, and a the new cached version being generated on the first relevant request. For our use case, this has resulted in some nasty race condition behavior with view cache files being read and written concurrently by concurrent requests, causing exceptions and other undesired behavior.Ex:
If we simply wrap
Spatie\LaravelPackageTools\Concerns\PackageServiceProvider\ProcessViews:14
with a call to PHP'srealpath()
function, the duplicated cache issue (and other downstream problems) is resolved.Curious if anybody else has experienced this problem and/or has any suggestions to fix or work around it.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions