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

[version 1.0? - develop] Is Navigation caching broken? #332

Open
Zerowalker opened this issue Sep 26, 2022 · 0 comments
Open

[version 1.0? - develop] Is Navigation caching broken? #332

Zerowalker opened this issue Sep 26, 2022 · 0 comments

Comments

@Zerowalker
Copy link

$menu = wp_cache_get($transientHash, 'municipioMenuCache' . $transientType);

From my understanding the point here is to cache the results for X amount of time and reuse it till that time (or when it's cleared manually).
(Also, why is this only implemented for MobileMenuAuto and no other menu?)

But when testing as far as i can tell it's not really used except if it's multiple calls during the same session i believe.
And in that case it's far less useful that it should be right?

I'm not that familiar with how WordPress caching works, but I think WP Object Cache isn't persistent anymore, but perhaps it was when this was implemented?

https://developer.wordpress.org/reference/classes/wp_object_cache/
looking there it says:

Prior to [WordPress 2.5](https://wordpress.org/support/wordpress-version/version-2-5/), data stored using the wp_cache functions was stored persistently if you added define('WP_CACHE', true) to your wp-config.php file.

This is no longer the case, and adding the define will have no effect unless you install a persistent cache plugin (see list below).

Any having one of those plugins might not always be the case.
So i'm wondering if it might be a better idea to utilise Transient API instead: https://developer.wordpress.org/apis/handbook/transients/

This isn't a complaint and I might very well be completely wrong, It's just meant as a feedback/question.
So i would love to hear your thoughts on this as I will surely learn a thing or two:)

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

No branches or pull requests

1 participant