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

Clear Config Cache on Changes To catalog_attributes.xml #52

Closed
sprankhub opened this issue Nov 12, 2019 · 5 comments
Closed

Clear Config Cache on Changes To catalog_attributes.xml #52

sprankhub opened this issue Nov 12, 2019 · 5 comments
Labels
bug Something isn't working confirmation-requested

Comments

@sprankhub
Copy link

If my test is correct, the config cache is not cleared when the file catalog_attributes.xml is generated or changed. This would probably make sense, right?

@Vinai
Copy link
Contributor

Vinai commented Nov 12, 2019

Thanks for reporting!
I vaguely remember the file might not be cached, but I might be confusing it with another one. But if so, maybe the FPC still needs to be cleared.
Do you find you have to clear the cache for modifications to take effect?
I'll check and will implement if needed.

@sprankhub
Copy link
Author

I do need to clear the config cache for modifications to take effect. In my case, I do not need to clear the FPC, because I work with the quote_item group on the cart page. This may be different for other groups / pages.

Thanks!

@Vinai
Copy link
Contributor

Vinai commented Nov 19, 2019

Note to self:
According to \Magento\Catalog\Model\Attribute\Config\Data only the cache ID catalog_attributes needs to be cleaned on changes, the remaining config cache can stay intact.

I'll implement this in the shortly upcoming release 1.0.5.
Could you then please report back if this works for you?
Thank you!

@Vinai Vinai added bug Something isn't working confirmation-requested labels Nov 19, 2019
@sprankhub
Copy link
Author

Thanks! This works. However, when I just change

<attribute name="my_attribute"/>

to

<attribute name="my_attribute2"/>

I see the clean message twice:

10:44:55 Cleaning id(s): catalog_attributes
10:44:55 Cleaning id(s): catalog_attributes

I guess one should be enough? :-)

@Vinai
Copy link
Contributor

Vinai commented Nov 21, 2019

The number of times the log message is shown depends on the number of file change events the file watcher receives. Nodejs uses inotify on Linux, kqueue on Macs / BSD systems, and ReadDirectoryChangesW on Windows, and even though they are nicely abstracted away, there are some runtime differences.
The events also seem to be influenced by the file system in use, i.e. if it's a mount or something else.
There isn't anything effective I can do to protect against duplicate events, except hide duplicate messages, but to be honest, I'd rather keep the code base smaller than add that feature :)

I'll go ahead and close the issue now. Thanks again for creating it!

@Vinai Vinai closed this as completed Nov 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmation-requested
Projects
None yet
Development

No branches or pull requests

2 participants