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

Are rendered posts cached?

Discussion in 'General XenForo Discussion and Feedback' started by Marcus, Sep 28, 2012.

  1. Marcus

    Marcus Well-Known Member

  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Nope. XenForo does not pre-render posts. That is an optimization I might expect to see in a future version.
  3. Marcus

    Marcus Well-Known Member

  4. Andy.N

    Andy.N Well-Known Member

    Digitalpoint mentioned something about this a while ago. He may have implemented it already for all we know.
  5. Marcus

    Marcus Well-Known Member

    It should be extremely easy. Just listen to the rendered post function and try to fetch it from the cache (#postid) first before executing it. If its not in there yet, run the rendered post function and save the result to the cache (#postid). Should be around 10 lines of code.
  6. CyclingTribe

    CyclingTribe Well-Known Member

    What about post edits? Would they be "pushed" into the cache?
  7. Insy

    Insy Well-Known Member

    Considering the performance of the file cache adapter of Zend Cache, I'm not sure that performance would be improved.
    The APC cache is too small to contain hundreds or thousands of messages, so caching rendered posts would be only interesting with Memcached.

    In my opinion, save the messages pre-rendered in the database would be sufficient for most users.
  8. digitalpoint

    digitalpoint Well-Known Member

    I did build one (it ends up making threads render about twice as fast overall). But it was really designed for in-house use (doesn't take into account style or language variations since my site only uses one style and one language) and doesn't take into account special permissions with attachments (everyone can see attachments that can see the post they are in on my site).

    Some info here: http://xenforo.com/community/threads/storage-of-parsed-posts.21904/#post-276766
    Xon, Marcus and Jake Bunce like this.

Share This Page