10up/simple-google-news-sitemap

Simplify cache handling

dkotter opened this issue · 1 comments

This is more of a question than anything but in our cache handling currently, we check if WP_CACHE is defined and if so, we use the wp_cache_* methods. If it's not defined, we use *_transient methods.

I'm wondering if this could be simplified to just use the core transient methods, as behind the scenes they actually check if caching is active (albeit a slightly different check then we are running) and use the wp_cache_* methods if so.

Seems like we would end up with the same result but with cleaner code. Not sure if there's something I'm missing though in the way it's currently setup.

@dkotter yes since core transient also uses cache behind the scene I think we can remove the cache logic and only keep transient, looping in @akshitsethi for his thoughts as well.