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

Noob to cache - question

Discussion in 'XenForo Development Discussions' started by 0xym0r0n, Oct 5, 2013.

  1. 0xym0r0n

    0xym0r0n Well-Known Member

    So this


    Code:
    $value = XenForo_Model::create('XenForo_Model_DataRegistry')->get('yourKey');
    reference: http://xenforo.com/community/thread...ll-users-over-several-runs.33600/#post-382901

    vs

    Code:
     return $this->getModelFromCache ('yourKey');
    In ControllerPublic...


    I see that the mb size and queries are the same for my add-on when I switch between them. Is there no difference other than how much it can store?
    Which would you use?
    I'm retrieving a variable amount of items which can be large and small. For now I'm using the getModelFromCache.

    I'm new to MVC and I'm new to cacheing data :p Pardon this special question please.
    Thanks <3
     
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    I believe getModelFromCache uses the first bit of code internally. The controllers just have a wrapper function (a rather common practice really).
     
    0xym0r0n likes this.
  3. 0xym0r0n

    0xym0r0n Well-Known Member

    Thanks :)
     

Share This Page