What should I do with Zend_Cache?

Source: Internet
Author: User
Tags zend framework
Ask Zend_Cache how to deal with the problem of recently Studying PHP Cache database data. zend & nbsp; framework has been used for a long time, which contains the Zend_Cache Cache class and can be used directly. now it is a bit of a problem. A user table needs to be cached. the main code is as follows: $ memcacheZend_Registry: get (memcache); & nbsp; if you want to know how to handle Zend_Cache
Recently I have been studying the issue of PHP Cache database data. I have been using zend framework, which contains the Zend_Cache cache class and can be used directly. now it is a problem.
A user table needs to be cached:
The main code is as follows:
$ Memcache = Zend_Registry: get ('memcache ');

If (! $ Admindata = $ memcache-> load ('data ')){
$ M_Admin = new Model_Admin ();
$ Admindata = $ m_Admin-> GetAllAdmin ();

$ Memcache-> save ($ admindata, 'data ');

}
A cached content marked as 'data' is cached above.
The difficulty is that it is better to update the cache. the number of users of this table is quite large, and some attributes are also in this user table. Therefore, the entire table is quite large. It is hard to say that one of my users has changed some information, so I will clear the entire cache and save it again? Or am I Updating the user information separately? (If so, what should I do ?)? Or what other solutions are available? could you please give me some guidance? thank you.

Cache zend database


------ Solution --------------------
The cache design is much more detailed, depending on your data size and update frequency.
If the cache is too thick, it will easily lead to faster updates.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.