-
-
Notifications
You must be signed in to change notification settings - Fork 550
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
[5.x] Static caching file path fallback #9306
Conversation
How are you invalidating |
That happens automatically when something changes according the invalidation rules in
|
I can't reproduce an error. Could you provide a sample repo with this problem happening? |
I'll provide more info shortly. Need to find some time :) |
I'm marking this PR as a draft in the meantime. When you're able to provide replication steps, feel free to mark it "ready for review" again and we can take another look. |
Alright, there we go; steps to reproduce this:
![]() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out this was because the domain wasn't being passed along.
If you pass //?phpinfo=1
, then parse_url($url)
would fail like you mentioned.
But if its http://domain.com//?phpinfo=1
, parse_url()
works as we expected.
Thanks! 🚀 |
Statamic\StaticCaching\Invalidate
sometimes throws errors like:This is caused by a "malformed url" like
//?phpinfo=1
which is saved in the cached urls list. When invalidating the url can't be parsed byparse_url()
as this function returnsfalse
when it's not a valid url: https://www.php.net/manual/en/function.parse-url.php#refsect1-function.parse-url-returnvalues