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

Fix bootstrap chicken and egg condition #50 #51

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

brendanheywood
Copy link
Contributor

Closes #50

Copy link
Contributor

@matthewhilton matthewhilton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this on my local instead just watching redis and hitting the front page after purging caches, and it appears to have stopped a whole load of other keys appearing in redis:

Before After
2024-06-13_08-02 2024-06-13_08-00

Some of these keys though look like lang string storage that is no longer being stored, which is interesting.
Checking the debug info, it looks like this is causing any cache that is not the config cache to use no caching, even on subsequent loads.

Before After
2024-06-13_08-10 image

Quickly stepping through with xdebug on I can see its hitting https://github.com/catalyst/moodle-tool_forcedcache/pull/51/files#diff-d265ec6c9603db572b0789e13a6e79a2b16bbf7e7ceef4b489ff497c7a9bb7dcR65 a lot while trying to make cache stores, which is strange since it should be set on the second request since the site identifier bootstrap file exists.

classes/cache_factory.php Show resolved Hide resolved
@matthewhilton
Copy link
Contributor

matthewhilton commented Jun 12, 2024

Turns out I had $CFG->siteidentifier = '' in my local which was causing it to never use the cache now with this patch which makes sense, it was doing its job as intended. After removing this it uses the cache after the first load as expected.

@brendanheywood brendanheywood merged commit 049b0e4 into MOODLE_40_STABLE Jun 13, 2024
16 checks passed
@brendanheywood brendanheywood deleted the siteid-fix branch June 13, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bootstrap chicken and egg issue with siteid
2 participants