Cache is breaking my site
-
Hi,
I love your plugin but it is giving me a small problem.
In content/plugins/picturefillwp/inc/class-picturefill-wp.php
You set a transient on the_content. You do this based on the post ID.But the following happens on the home page.
- I display the 2 newest posts
- I get a theme option with:
echo apply_filters('the_content', get_option('theme_tinymce_formated_option'));
This option has text from tinymce and basicly works the same as a post. content wise.
-
You plugin checks for cache based on
get_the_ID()
which is post #2, which it finds as it’s fetched/created above. - You plugin displays the cached version of post nr 2 instead of my theme option.
If your plugin should cache something that so many plugins might affect is a different debate.
But I do have a way to solve this. instead of basing this on a post id which might not even exist. why don’t you create a (md5?)hash of the given content and use that hash as the transient key.
That way if an author fixes a typo or a other plugin changes the_content your plugin won’t hit the cache because a single letter change will give a different key.
For now I quoted the cache out entirely.
Hope you will consider this.
- The topic ‘Cache is breaking my site’ is closed to new replies.