1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

hCacheMe 0.1

Discussion in 'Plugins' started by narc, May 15, 2013.

  1. narc

    narc Well-Known Member

    Version: 0.1

    Author: Andreas Votteler
    Created: 2013/05/15
    Last Updated: -
    Tested on: Hotaru 1.4.1 ~ 1.5.0 beta
    Plugins Required: None
    Plug & Play: Yes
    Supported: No

    apc cache for hotaru

    Live Example:
    live example can be viewed here: trendkraft.de


    1. Upload the "cacheme" folder to your plugins folder.
    2. Install it from Plugin Management in Admin.

    Please click "Rate Thread" and give this plugin a rating. Thank you. :rolleyes:

    Revision History
    v0.1 2013/05/15 - narc - Released first version

    Attached Files:

    Last edited: May 15, 2013
    shibuya246 and nothingman like this.
  2. narc

    narc Well-Known Member

    I have written a small cache plugin. hotaru would bring something?
    of course installed APC is used for the function.
  3. nothingman

    nothingman Active Member

    Read somewhere that APC is not available on shared servers and that you need to have root access. So, is this plugin of any use for us who are on shared servers? :confused:
  4. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    I this plugin could also be put on github then I will take a look at. Maybe we can put a test for "Is APC available?" in the admin settings for this plugin
  5. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    I recommend you put this at the top of the cacheme.php page

    public function theme_index_top($h)
            // fail if apc not loaded
            if (!extension_loaded('apc')) return false;

    so that if the apc module is not installed on the machine then it will not deliver a fatal 500 error
  6. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    I also added this to the cachme.php file

     * hooks: theme_index_top, debug_footer
        public function debug_footer()
                if (!extension_loaded('apc')) { 
                    echo " | apc not loaded";
                } else  {
                    $cacheid = 'cacheme_' . md5($_SERVER['REQUEST_URI']);
                    if(apc_exists($cacheid) != false) $msg = " and page was cached"; else $msg = " but page not cached";             
                    echo ' | apc loaded' . $msg;
    This will place a message in the footer of the page when in debug mode
    which will show whether the module is loaded and whether the page being viewed is cached

    This debug_footer hook is new in v.1.5.0 and will be on the next release. It is there as a convenience for debugging sites so you can get information about what is going on. Remember, when your site is in full production, you should not really have debug mode on

    Screen Shot 2013-05-15 at 1.15.46 PM.png

    Screen Shot 2013-05-15 at 1.15.59 PM.png
  7. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    depends on your provider. I have suggested the code be changed in this plugin to not throw a 500 error when apc is not installed, and also show a message in debug mode so you can see whether it is on and pages are being cached. I have it running on ipadrank.com now and it seems fast but I dont have much content. I am going to copy across a large database from _________ this afternoon and try to see what results I get on a fully loaded site.

    You should ask your provider whether they have apc available and whether they can turn it on for you.

    Hotaru CMS does have other caching going on separate for css, js, html, database, rss and internal memory calls. There is a lot being cached when its running. APC and memcache are extra to these things and may add some benefit, but your site should not be slow without them.

    I am also checking a few database calls in the plugins (displaying dat in the widgets area) which may slow some sites. If we can improve those areas we can make things look faster
  8. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    Might be an idea to have a Turn Cache on/off button in the admin plugin setting for this
    Also,if you put it on github I will write a quick "show last 10 cached pages" display in the admin plugin section also

    Can you include a readme file for this plugin later?
  9. narc

    narc Well-Known Member

    hi Shibuya. Thank you for your feedback signal. I have the plugin uploaded in git.

    the new hook and the readme file is also been added. if you have ideas how the plugin can not be extended. I listen intently.
  10. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    I have tidied a few things up, added a check for if apc is installed on server or not and made a quick dashboard. I am making a pull request on github now for it.

    I suggest you have an ON/OFF button in the settings page, and maybe a flush cache button. Also maybe a setting to change the time of cache duration
    nothing urgent though. It works well already

    This looks hot in the new admin dashboard for v.1.5.0
    Screen Shot 2013-05-16 at 12.57.42 AM.jpg
    narc likes this.
  11. narc

    narc Well-Known Member

    the dashboard is sexy. very beautiful.:)

    you could insert another field in which the cache time is defined. at the moment it is permanently set to 300. also a possibility to work with gzip could be implemented.

    that with the off / on button is a good idea, also a flushcache button. I'll watch it for me once. 'm only just working to help make hseo run.

Share This Page