Seven cache application weapons accelerate website usage and visits

Source: Internet
Author: User
Seven weapons of cache in Web exploitation: 1 Database cache usually supports cache of query results, and there is a complicated mechanism to ensure the effectiveness of the cache. For databases such as MySQL and Oracle, fair configuration of cache brings about

Seven weapons cached in Web exploitation:

1. Database cache

Generally, databases support the cache of query results, and there is a complicated mechanism to ensure the effectiveness of the cache. For databases such as MySQL and Oracle, the promotion to system performance through fair configuration of cache is quite obvious.

2. data connection-driven cache.

For example, php adodb, J2EE connection driver, or even HIbernate and other ORM as connectors. The cache effective mechanism here is not that strong. one of the best advantages of using this method to implement cache is that the data retrieval method can remain unchanged. For example, I call
$ Db-> CacheGetAll ('select * from table'); statements do not need to be changed and can be cached transparently. This is mainly used in some data with minor changes. for example, some data dictionaries do not change frequently.

3. system-level cache

You can use the Cache library in the system to Cache the required data. for example, if a tree menu is inherently resource-consuming, you can Cache the tree. The problem with doing so is that when some parts of the tree are updated, you need to manually update the content in the cache. Different caching methods can be applied to cache databases. some store the content on the hard disk, and some store the content in the memory. if you mimic the content into a hard disk for caching, the speed can certainly be improved a lot.

4 page-level cache

This is the most used in the content governance system. That is, the natural static page. Here, the cache control mechanism is the most complex, and there is generally no cure for all kinds of problems. only the specific situation is analyzed. Generally, you need a mechanism to delete expired or visit a few leaves to ensure the speed of searching static leaves.

5. Pre-compile and load the application as FastCGI

For PHP, zend and other compilation engines can be applied, and JSPs are pre-compiled. FastCGI's principle is to pre-load the script without reading it every time. This is the same as JSPs pre-compile the Servlet and then load it.

6 Pre-cache

You can use Squid as the front cache of the Web server.

7. cluster creation

Cluster databases, web servers, and Squild front-end servers
For a newbie, if your program passes away, you should first check whether the code is wrong and whether there is memory leakage. If no, the title is usually on the database connection.
Using the cache method above, it is easy to develop high-load Web application performance.

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.