Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the commonly used buffering techniques

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Today, I will talk to you about the commonly used buffering techniques, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following for you. I hope you can gain something according to this article.

I. data caching

The data cache here refers to the database query cache. Each time a page is visited, the corresponding cache number will be detected first.

According to whether it exists, if it does not exist, connect to the database, get the data, and serialize the query results and save them to a file

Later, the same query results are obtained directly from the cache table or file.

The most widely used example is Discuz's search function, which caches the results ID into a table, and the next time you search for the same keyword

Search the cache table first.

As a common method, when multiple tables are associated, save the generated array of the contents of the schedule to a field in the main table.

When you want to decompose the array, the advantage is to read only one table, but the disadvantage is that there will be a lot of steps to synchronize the two data.

The database is always the bottleneck, and the key point is to exchange the hard disk for speed.

Second, page cache

Every time you visit the page, you will first check whether the corresponding cache page file exists, and if not, connect the data.

Library, get the data, display the page, and generate the cache page file at the same time, so that the page file will act as

I used it. (template engines and some cache classes common on the Internet usually have this feature).

Time-triggered caching

Check whether the file exists and the timestamp is less than the set expiration time, if the modified timestamp of the file is less than the current timestamp

If the expiration timestamp is large, then use the cache, otherwise update the cache.

IV. Content trigger cache

Forces the cache to be updated when data is inserted or updated.

5. Static cache

The static cache here refers to statically generating text files such as HTML or XML and regenerating them when they are updated.

Once, suitable for pages that do not change much

The above content is a code-level solution, I directly CP other frameworks, also do not bother to change, the content is similar, it is easy to

Do it, and it will be used together in several ways, but the following is a server-side caching scheme, non-code-level, with more

It can only be achieved with the cooperation of Fang.

VI. Memory cache

Memcached is a high-performance, distributed in-memory object caching system used to reduce database load in dynamic applications

Increase the speed of access.

7. Buffers and accelerators of PHP

There are eaccelerator, apc,phpa,xcache.

8. MYSQL cache.

9. Web cache based on reverse proxy

Such as Nginx,SQUID,mod_proxy (above apache2 is divided into mod_proxy and mod_cache).

After reading the above, do you have any further understanding of the commonly used buffering techniques? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report