Seven types of caches using weapons for Web site application and Access acceleration

Source: Internet
Author: User

Seven types of weapons cached in Web applications:

1 Caching of databases

Typically, the database supports caching of query results, and there are complex mechanisms to ensure the effectiveness of caching. For databases such as mysql,oracle, the improvement of system performance through reasonable configuration caching is quite significant.

2 data connection-driven cache.

such as PHP adodb,j2ee connection drive, even if the hibernate and other ORM also as connectors. The caching-efficient mechanism here is not so strong, and one of the best advantages of caching in this step is that the way we take the data can remain unchanged. For example, I call
$db->cachegetall ("SELECT * from table"); Statement does not need to be changed to transparently implement the cache. This applies primarily to data that is not very much changed, for example, some data dictionaries are not constantly changing.

3 System-Level caching

Can be in the system through the cache, the need to cache the data, such as a tree stump menu generation is very consuming resources, that can be the resulting tree cache. The disadvantage of this is that when some parts of the tree are updated, you need to manually update the contents of the cache. Use of the cache can have different caching methods, some put the content on the hard disk, some in the memory, if you have to simulate the contents of the hard disk to cache, of course, can also improve a lot of speed.

4 Page-Level caching

This is the most used in the Content management system. Which is to generate a static page. This is the most complex caching control mechanism, there is no general treatment of all diseases, only the specific circumstances of the specific analysis. Normally generated static foliage you need to have a mechanism to remove obsolete, or access to a few foliage, to ensure that the speed of retrieving static foliage.

5 Using precompiled foliage and loading as fastcgi method

For PHP, you can use a compile engine such as Zend, which is precompiled for the JSP itself. And the principle of fastcgi is to preload the script, do not have to read every execution, this and JSP into a servlet, and then load the truth is the same.

6 predecessor Cache

You can use squid as a front cache for a Web server.

7 Do Cluster

Cluster the database, cluster the Web server, and cluster the Squild front machine
For beginners, if your program is dead, first you have to check the code for errors, whether there is a memory leak, if not, then usually the problem is in the database connection.
Comprehensive application of the above caching method, the development of high load Web application achievements is easy.



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.