A Simple Cache plugin - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: Plugins (http://get-simple.info/forums/forumdisplay.php?fid=13) +--- Thread: A Simple Cache plugin (/showthread.php?tid=1109) Pages:
1
2
|
A Simple Cache plugin - RobA - 2010-11-11 Hi- I just uploaded a very basic page cache plugin: http://get-simple.info/extend/plugin/simple-cache-plugin/56/ Page content is cached. The cache is flushed when any page is saved. There is no time expire on the cache files in this version. I've tried it on my site and it works quite nicely. Note that the use of any page cache will prevent plugins that generate dynamic content from functioning properly. Thoughts? -Rob A> A Simple Cache plugin - Carlos - 2010-11-11 In a quick test, I've found that non-existent pages ("Oops! Not found") also get cached (one cache file for each different URL). BTW there already was another similar plugin, nexflo's GS_cache: http://get-simple.info/forum/topic/608/gt-cache/ You may find some ideas for yours in that thread. A Simple Cache plugin - RobA - 2010-11-11 Carlos Wrote:BTW there already was another similar plugin, nexflo's GS_cache: Grrr. I searched both the forums and the Extend site and found no page cache. Oh well. I took some ideas from that code, played with setting up a back end page to delete individual pages or flush the entire cache. Still working on it though. (latest version is in Extend) Two questions - Is there a plugin configuration framework in place or does each plugin handle its own configuration stuff? Can a plugin register in more than one backend location? I wanted to have a config page (ttl, pages to exclude from caching) as well as a cached pages management page, for logical separation. If not I guess it can all be in one and I'll move it to the plugin page. -Rob A> A Simple Cache plugin - RobA - 2010-11-12 Update to 0.3. I rejiggered things a bit so cache files are stored with MD5 hashed filenames. The backend UI looks like the attached, showing the pages and their cache status, using the GS classes for a consistent look. Still need to get the parent/child logic in so it displays same as the View All Pages page. In an ideal would that UI would be extendable and I could have just added a column in there, oh well. I plan to add another column of checkboxes so you can control whether each page is cached (the code is there right now but the only page islug in the array is '404' so the page not found page is not being cached). I was hoping to get an answer on storing plugin configuration information first, rather than voyaging out on my own. I also was going to add a configuration parameter of the time to expire a cached page as a user setting. -Rob A> A Simple Cache plugin - RobA - 2010-11-13 Updated to version 0.4 - I'm almost ready to call this a 1.0 The SimpleCache plugin now has:
Attached is a screen grab of the backend. I'd love:
-Rob A> A Simple Cache plugin - Carlos - 2010-11-13 Those new expire and page exclude options are great, very nice plugin! A Simple Cache plugin - Oleg06 - 2010-11-13 yes, great plugin A Simple Cache plugin - ccagle8 - 2010-11-13 This does look great Rob! A Simple Cache plugin - kirilldmt - 2010-11-14 Very nice plugin, but it doesn't cache pages from the second page of list in admin panel->pages. Or i may say in other way - your plugin cache only 15 pages. A Simple Cache plugin - RobA - 2010-11-14 kirilldmt Wrote:Very nice plugin, but it doesn't cache pages from the second page of list in admin panel->pages. Can someone else test that? There is nothing that should prevent more than 15 pages from being cached... -Rob A> A Simple Cache plugin - Carlos - 2010-11-14 In SimpleCache status page I get a list of a maximum of 14 pages. :-? However, all pages seem to be cached ok (when browsed, of course). (Quick test done with 30 pages.) A Simple Cache plugin - Carlos - 2010-11-14 Ok, found it. Only first 14 pages are shown when javascript enabled. Some conflict with page editor styles. Fix: Edit simplecache.php, line 336: Code: echo '<table class="edittable highlight paginate">'; Code: echo '<table class="edittable highlight">'; A Simple Cache plugin - RobA - 2010-11-14 Carlos Wrote:Ok, found it. Only first 14 pages are shown when javascript enabled. Some conflict with page editor styles. Thanks. That's what I get for borrowing styles without digging deeper. Would pagination in the backend make sense? Alternately, a hook in the main pages page would let me inject new columns in to the existing table without reconstructing everything. Rob A> A Simple Cache plugin - RobA - 2010-11-16 Another small update - now at 0.5
-Rob A> A Simple Cache plugin - RobA - 2010-12-01 Another tiny update - Borrowed the page sorting code from the core so the cache will display in the same order. -Rob A> A Simple Cache plugin - RobA - 2010-12-15 I want to make it easier to work with other plugins/dynamic content generation. The easiest way to do this to to come up with a comment, say: Code: <!-- SimpleCache NO --> That a plugin can emit in the page, and then my plugin would ignore that page and not cache it. I tried it on my dev server with a test plugin and it seems to work well, and is easier than a user having to go into the cache settings and disable the cache for that page. Thoughts? -Rob A> A Simple Cache plugin - RobA - 2011-04-21 I've updated this plugin in extend: - code cleanup - improved XML config file handling - proper use of quotes - updated to GS coding style - updated backend to use GS3 classes -Rob A> A Simple Cache plugin - RobA - 2011-05-27 One more small update - bugfix for proper sorting of pages nested more than one deep - updated list display to use the same style as the page management page. -Rob A> A Simple Cache plugin - Carlos - 2011-06-23 Suggestion: only serve cached pages to users who are not logged in (or make this optional) Another one: What about moving SimpleCache Settings to the top of the settings page, before the SimpleCache Status list? (or at least put an anchor link there) A Simple Cache plugin - RobA - 2011-06-24 Carlos Wrote:Suggestion: only serve cached pages to users who are not logged in (or make this optional) Good idea on the organization - I've changed it in my core and will update extend that way at the next big change. Regarding the other, I'm still developing for 3.0 as it is the current official release and the cookie magic to determine if a use is logged in is broken, so there is no easy way to do this (from the front end pages) without changing the core code. -Rob A> A Simple Cache plugin - mvlcek - 2011-06-24 RobA Wrote:Regarding the other, I'm still developing for 3.0 as it is the current official release and the cookie magic to determine if a use is logged in is broken, so there is no easy way to do this (from the front end pages) without changing the core code. A workaround for the cookie problem in 3.0 can be found here. A Simple Cache plugin - RobA - 2011-06-24 mvlcek Wrote:RobA Wrote:Regarding the other, I'm still developing for 3.0 as it is the current official release and the cookie magic to determine if a use is logged in is broken, so there is no easy way to do this (from the front end pages) without changing the core code. As far as I can tell, that only works in the back end. -Rob A> A Simple Cache plugin - mvlcek - 2011-06-25 RobA Wrote:mvlcek Wrote:A workaround for the cookie problem in 3.0 can be found here. It works when calling php-files in the plugins folder. It works when calling this test file in the root of the installation: Code: <?php A Simple Cache plugin - RobA - 2011-06-25 mvlcek Wrote:RobA Wrote:mvlcek Wrote:A workaround for the cookie problem in 3.0 can be found here. It doesn't. common.php has the code: Code: /** so cookie_functions.php doesn't get included when viewing a page in the front end. Sure it works in stand alone files because of the $base check. -Rob A> A Simple Cache plugin - mvlcek - 2011-06-25 RobA Wrote:so cookie_functions.php doesn't get included when viewing a page in the front end. Sure it works in stand alone files because of the $base check. If this is the only problem, you can include the cookie_functions.php yourself (or copy the cookie_check function). But it really depends on how important the functionality is to you and the users of your plugin ;-) |