I have never quite understood why memcache is used when smarty is used ~
Source: Internet
Author: User
I never quite understand why memcache is used when smarty is used ~~~~ It is said that smarty & nbsp; + & nbsp; memcache is a good combination of optimization, but I don't understand why memcache is used when smarty is used ~ Because smarty does not have a page cache, for example, I have never understood why I still need to use memcache when I use smarty ~~~~
It is said that the combination of smarty and memcache is a good combination of optimization, but I don't understand why memcache is used when smarty is used ~
Because smarty does not have A page cache. for example, if there is A page A, I set it to be cached for 10 minutes, so it only needs to perform A logical operation every ten minutes. What is memcache used?
Can you give me a small example of how to use smarty and memcache?
Thank you! Share:
------ Solution --------------------
The storage space is different. memcache is stored in the memory, and smarty is saved to the hard disk. reading data must be fast from the memory. you can see how these two functions work.
------ Solution --------------------
Since smarty can be cached. Why memcache?
------ Solution --------------------
This principle is simple: because of the different operating mechanisms and applicability, smarty is only used by a few junior php programmers, and memcache is widely adopted, and thus a memory-based database system is derived.
------ Solution --------------------
One is for data, and the other is for the Accessed page. for example, you can save the queried data to memcache at the longest time, however, if some pages do not require high real-time refresh, the smarty cache takes effect in different scopes, just as if you have eaten carrots and watermelon, and eating carrots increases vitamin C, eating watermelon increases vitamin D. If you are still confused, you don't have to worry about it. you will know it later.
------ Solution --------------------
Two different things... as kyzy said. Although it is a cache service, the specific cache objects and implementation methods are not the same. Although the various SM can also be integrated with each other, but it is a little bit off the pants.
Simply put, the final result of the smarty cache is the part in the memcache cache. of course, this is also general, but you can know how much they are not trying to solve the intersection of the same problem.
------ Solution --------------------
Smarty's cache is file-based and can be called filecache
File access must be slower than memory access
That's why smarty + memcache
That is to say, you can modify the smarty to put the cache in memcache.
As for what to use and how to use it, it is a solution problem. Independent from implementation technology
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.