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

Caching for My Plugin

Discussion in 'XenForo Development Discussions' started by CaptainMorgan, Oct 7, 2014.

  1. CaptainMorgan

    CaptainMorgan Active Member

    My plugin relies on 3rd party urls getting examined and their server uptime, not via database storage that XenForo is running on. (would this be a better solution?)

    I found several examples online, but apparently the XenForo templating system doesn't agree with the examples since I get Template Error: Page_Container. I tried inserting the code line in the templateHook call to my chagrin. (ie: after the finding the correct hook: ob_start(), before the main code, and just after $contents .= $pluginContents; ob_clean() or whathaveyou)

    I also get fopen permission errors for the cache file and the folder and cache file for writing, even the script itself is set to www-data.www-data and all are given write permissions.

    Has anyone gotten a cache system to work for their plugin? Or maybe you leveraged the Zend Framework somehow? If so on either question, please let me know.

    Thank you!
  2. CaptainMorgan

    CaptainMorgan Active Member

    600 people viewed, not one response, eh?
  3. CaptainMorgan

    CaptainMorgan Active Member

  4. thedude

    thedude Well-Known Member

    Depending on the frequency that you need to access this data, you could use the database with your own table to store the data and query your table when you need to lookup info on these urls, the XF simple cache (which I believe gets loaded on every page load), or whatever is the configured back end cache i.e. memcache.

    If you only need to lookup the info when a post is made, I would go with the database option, but you didn't give more specifics so it's hard to say.
    CaptainMorgan likes this.

Share This Page