Build a Web Cache Server

Source: Internet
Author: User

I. Description

 

As the number of visits to the website increases, the load on the website also increases,DatabaseLoad changes are particularly evident, especially during peak periods of access, users' browser pages are displayed slowly, and even a text page cannot be displayed for a long time. The worst case is that the website crashes directly, it seriously affects the user experience and reduces the stickiness of the website. At this time, we must consider buildingWebCacheServerIt's time.

 

We chose Fikker The website acceleration product is used as a reference example. According to the official introduction, Fikker Is a cache acceleration product based on high-speed memory. It has no cache file generation and supports cross-platform ( Windows And Linux ), In V3.2.4 You have not seen FreeBSD The free version of the operating system is used as an example. Build Web The purpose of the cache server: in addition to reducing the load on the website server and accelerating page display, it can also hide the source station for traffic statistics and real-time monitoring, or even anti-leech protection, the most important thing is that you do not need to modify the existing website throughout the process.ProgramOfSource code, Full-Interface Web Cache configuration operation.

 

Ii. preparation stage

At this stage, we first go Fikker Download it from the official website. What we download and use is Centos Linux Version, whether it is Linux Or Windows Version, entireInstallIt is very similar to the configuration process. We will download the installation package Fikkerd-3.2.4-linux-x86.tar.gz Put in /Home/Meng Run the following command to decompress the package:

Tar zxvf fikkerd-3.2.4-linux-x86.tar.gz

 

Iii. Configuration phase

1, According Fikker Installation instructions. At this stage, we can perform related configurations. Currently Apache Occupied 80 Port. For the sake of security, we first test and then implement it. Now we will Fikker Default port 80 Change 8080 In this way, we can Fikker After the configuration and test are complete, you can add the service to the actual service without affecting the original website. First modify Config Directory Fikkerd. ini Configuration file (Command Behavior: VI fikkerd. ini ), As follows:

After the configuration is modified, save the modification and exit the editing (the Chinese comments in it are garbled and supportGBKCharacter encoding terminal display is normal ).

 

2. StartFikkerServer process, command line:

Sudo./fikkerd. Sh start

SeeOKThe prompt is complete.

 

3. I usedCentosThe following built-inFirefoxBrowser login and configuration, remote configuration through the browser, the operation process is exactly the same. Logon address:Http: // 127.0.0.1: 6780/fikker/.

 

4. Host Management Configuration, Fikker As a proxy server, the browser first accesses Fikker , And then Fikker After accessing the origin site and obtaining the page, Fikker Return the page to the browser. HTTP Proxy process, Fikker Reached Web The purpose of page caching. Host Management Configuration example:

 

5. Page cache configuration: Specifies the page to be cached. URL and cache cycle, then fikker the corresponding page is updated and cached according to this cycle. For example, we want to cache the directory www.baidu.com/pics/ all JPG image, we can use wildcards www.baidu.com/pics/developer.jpg . You can also use complex regular expression rules to match. Refer to the following example to add other Web page:

 

Iv. Final Stage

With the above configuration, everything is ready and we will modifyApacheAndFikkerAnd thenWebThe cache server runs.

1. SetApacheInHttpd. confFromModify listen 80 to 8080.

2. Change the port in fikkerd. ini from proxy_port 8080 to 80.

3. Restart the Apache server process.

4. Restart the fikker server process with the command sudo./fikkerd. Sh restart.

 

Visit the website through a browser and test whether the website can be accessed normally. If not, Modify host management to check whether the host and origin site configuration are correct. Other fikker configurations, such as page caching, anti-leeching, and blacklist, can be constantly optimized and configured in fikker operations. After the configuration is complete, the configuration takes effect immediately without restarting the fikker process, continuously learn and reference the online help system (and related help) to accelerate website optimization to the optimal state. It is really useful to simply learn the most commonly used regular expressions. It can actually make your website cache go fast.

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.