I understand, it is hard to justify adding complexity when the plugin already fulfills its function perfectly on a core install. However I think this is an exceptional circumstance where it is justified.
This is basically an issue of cache-invalidation, saying part of the page needs to be refreshed, and that is a very hard (if not impossible) problem to solve from the top-down. WP Super Cache does not do it to my satisfaction.
Cache-invalidation on WordPress is even harder because of its architecture. Everything on a given page is generated as part of a monolithic view, with one entry point at the very beginning and no hooks for a third party to know what rendered what on the page and what changed since last time. Therefore the only way to get a new version of part of the page is to rerender the whole page.
However lets say you could rerender just the part you needed. Then theres still the issue of how to merge that into / compose it with the existing cached page. Do you perform complex string manipulation on the server side? Do you defer it to javascript and do a jQuery(‘…’).replace()? Something else? Both of those have drawbacks and may not work in a lot of cases.
Once you solve that problem, there is still a more fundamental issue with this whole approach to caching, and thats that it requires spinning up PHP to coordinate (even if the cached page is fine as is). In my case PHP is the slowest component, adding 0.5s to 1s to page load time (its using SuPHP, and I cannot yet move to PHP-FPM). Most of the savings I get from caching come from avoiding hitting PHP in the first place.
So cache-invalidation has to happen from the bottom-up (I should say “cache-invaldation” with air-quotes because my point is basically we have no way to do it at all on WordPress). Every developer has to write their own solution to make their particular plugin display the latest information in the most seamless way possible. Your plugin would be very easy to do that for, since its views are encapsulated and parameterized, and just need to be exposed via AJAX.
Hiding it behind a feature checkbox would allow people to use it when they need it, and disable it when they don’t care about the caching and don’t want the javascript overhead.
-
This reply was modified 8 years, 5 months ago by
JProffitt3G.