Skip to content
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

Dont collect site URLs unless "generateOnRefresh" is selected. #590

Closed
Romanavr opened this issue Nov 28, 2023 · 2 comments
Closed

Dont collect site URLs unless "generateOnRefresh" is selected. #590

Romanavr opened this issue Nov 28, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@Romanavr
Copy link

Romanavr commented Nov 28, 2023

Hi,
I have a large site with over 50 subsites, and after a recent Blitz update, I ran into an SEOmatic issue where the "Content SEO" update results in a very looooooong save and sometimes causes a PHP timeout.
In fact, we have this case before a year ago(almost on the same date, lol). #455

So I went to check what could be wrong here and, surprise, found that it was the same problem as last time.
Getting website URLs takes a lot of time when saving anything in SEOmatic as it triggers blitz cache refresh.

My mode is set to clearOnRefresh so I don't see any good reason to collect site URLs in this case.
I understand that it is being used right now in the EVENT_BEFORE_REFRESH_ALL_CACHE, but from my point of view it make no sense to have $siteUris here, before the
if (Blitz::$plugin->settings->generateOnRefresh()) {
line

. It doesn't change site URLs after the event fires, so we can remove it and if the some developer wants to use it, they can just look at the source code and use them at the same way.

I suggest 589 as a solution, but if you disagree, please let's find something else where we don't need to collect site URLs unless "generateOnRefresh" is selected. (for the 3.x it was fixed in #456)
With this solution, saving in SEOmatic takes only a few seconds instead of 1+ minute.

Craft pro 4.5.11.1
Blitz 4.9.1

@Romanavr Romanavr added the bug Something isn't working label Nov 28, 2023
@Romanavr Romanavr changed the title Dont collect site URLs when "clearOnRefresh" selected Dont collect site URLs unless "generateOnRefresh" is selected. Nov 28, 2023
@bencroker
Copy link
Collaborator

Thanks for the explanation. I’ve reverted this in 4fb6f0a and released in 4.9.2.

@Romanavr
Copy link
Author

Thanks for the explanation. I’ve reverted this in 4fb6f0a and released in 4.9.2.

Thanks for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants