-
Notifications
You must be signed in to change notification settings - Fork 7
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
Cannot purge; no valid URLs #66
Comments
Have you added the craft-cloudflare/src/config.php Lines 38 to 40 in 9d391f6
|
In that case it should work. Can you verify that |
When I save one entry it returns true, but the thing is that I programmatically save about 4000 entries through a queue and just after that I get about 100 errors in the logs like this. Is there some way to use something like you implemented in Blitz:
|
No, there is not – this plugin is nowhere near as sophisticated as Blitz. A possible workaround would be to disable purging of entries by default, and manually call |
Yes, but this will disable this option for other sections. Is it possible to add specific sections instead of the element type? |
It’s not, but you can disable the entry element type just for the duration of your custom code. Cloudflare::$plugin->settings->purgeElements = [];
// Save elements and store URLs
Cloudflare::$plugin->api->purgeUrls($urls); |
Thanks! I'll try that and get back to you. |
Sorry, can you please explain? Why do we call a method to purge urls if they don't exist? I can't disable updating of entries.
|
What I was suggesting is that you first disable automatic purging of all element types: Cloudflare::$plugin->settings->purgeElements = []; Then, after you’ve programmatically updated entries, you manually purge their URLs: Cloudflare::$plugin->api->purgeUrls($urls); But now I also see what you meant about errors being logged. Are you concerned about the errors themselves or is something not working the way it should? |
I believe that error message is just being incorrectly logged, there’s nothing to worry about and I’ll add a fix for this. But I’m confused as to whether otherwise everything is working for you or not? This issue is getting very long and I’m not sure where we are with it. |
Yes, everything else works, thanks. I was just interested in this particular error. |
Thank you so much! |
If I change an entry through the edit page, cache will purged correctly, but if programmatically update entries and do it through a queue, I will get the error - Cannot purge; no valid URLs.
By programmatically, I mean that I do it using the PHP code in the module, something like this:
The text was updated successfully, but these errors were encountered: