About the cache application of the website (B/S under development) (multiple images)

Source: Internet
Author: User

Some of my views on cache in development of medium/large development B/S are incorrect or incorrect. please correct me. Thanks

First, you should understand the basic knowledge about Caching:

Q: What is the difference between static cache and dynamic cache? What is cache?

A: cache. in a simple way, there is no need to interact with the database again.

Static cache: an HTML or shtml file.

Dynamic cache: it is called to save the cache to the server's memory.

Where are their differences --

Static cache does not occupy load (Server Memory), but takes up server space (because many files are generated). The most important reason is that a static cache is generated, which is not conducive to maintenance, because when you design a system, you must consider the consequences of using this. As described in the design model, some models are flexible, some models remain unchanged at the beginning of deployment.

Therefore, once again, be careful when designing. Consider as many things as possible, such as: whether the system is applicable after upgrade (think as much as possible), whether it is helpful to change the template, and add special or specificCode, Using shtml or HTML? And so on.

For dynamic cache, I think everyone should know that application is used as the cache class written by the "fans" on the Internet. This is a classic example of using dynamic cache in ASP. Therefore, I do not need to mention too many application caches. Its advantage is that the static cache is more conducive to maintenance and upgrade. Static cache and dynamic cache

 

A: When to use static cache and dynamic cache?
Q: How do you deploy servers and design your servers?ProgramWith the code
For example:

My server load is large enough, so you don't need to consider the memory here, so you can use a lot of dynamic cache, such as news index pages, home pages, more index pages. Instead of generating static ones. For example, the previous versions of mobile Yi (I know the current version, but now it seems that static caching is adopted) widely adopt Dynamic Caching technology. Therefore, when updating the cache in the background, you need to manually update the cache. Of course, you can use URL rewrite here, which is more conducive to search engine indexing. Note: This is also very important. It also reminds many people who set up servers that the search engine is not very friendly.
(Generally, the search engine's robot is included in the website. It will always crawl your website. Therefore, it is necessary to build a traffic access system. Remember cnblog) in the detection, dodo finds that Yahoo's robot crawls several times as many as Google per minute, which has an impact on your website's speed. Sometimes, it is quite high)

Static cache, as mentioned above, is not conducive to maintenance. However, the widely used MVC development method can improve the speed of separating pages from programs, as shown in the figure below.

Q: Are there other methods to deploy them?
A: Yes. As shown below. The proxy technology is used to design and obtain the static cache availability through code. If it is available, if it is unavailable (the cache does not exist, or the cache has been changed), the output is generated again. Otherwise, the output is directly.

Dynamic cache and static cache are used for complete communication. It briefly explains how to deploy and apply the cache. Of course, you do not need to use the cache proxy for judgment. The same is true if cacheproxy is removed.

 

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.