nystudio107 / craft-seomatic

SEOmatic facilitates modern SEO best practices & implementation for Craft CMS 3. It is a turnkey SEO system that is comprehensive, powerful, and flexible.
https://nystudio107.com/plugins/seomatic
Other
166 stars 71 forks source link

Error on save SeoMatic settings #1463

Closed umkasanki closed 7 months ago

umkasanki commented 7 months ago

Describe the bug

We have a large site with Blitz + Cloudflare caching. When trying to save plugin settings after a long delay, we receive an error.

To reproduce

Steps to reproduce the behaviour:

  1. Go to "SeoMatic settings"
  2. Click on "Save"
  3. See error message " A timeout occurred Error code 524 "

The error occurs when we have a lot of cached pages. It looks like SeoMatic is trying to clear the Blitz cache. But since there are a lot of pages, an error occurs.

Expected behaviour

Could you configure the execution of cache clearing tasks using jobs?

Versions

khalwat commented 7 months ago

This isn't an SEOmatic issue, this is a devops issue of some kind:

https://phoenixnap.com/kb/error-524

When you save settings in SEOmatic, all it does is invalidate its own caches, it doesn't invalidate any Blitz caches:

https://github.com/nystudio107/craft-seomatic/blob/develop-v5/src/controllers/SettingsController.php#L1079

https://github.com/nystudio107/craft-seomatic/blob/develop-v5/src/Seomatic.php#L304

I don't know if Blitz does something additional, but I don't think so, because SEOmatic doesn't throw any events when you save the plugin settings.

In any event, this is an error from CloudFlare, and it's saying it's taking too long to refresh a page from the origin server. It doesn't make much sense to me that you'd see this error in the CP, where pages shouldn't be running through CloudFlare anyway but... I'm fairly certain this is going to end up being a devops issue on your end, and not an issue with SEOmatic.

umkasanki commented 7 months ago

Thanks