Purpose: To cache the static files of the Nginx server. As css,js,htm,html,jpg,gif,png,flv,swf, these files are not updated frequently. Easy caching to ease server pressure.Implementation: Nginxproxy_cache can cache the user's request to a local directory, when the next request can be directly transferred to the cache
There is only one live server on the line, it is now business to give another company live broadcast, a server bandwidth can not meet, business, Director, Operations (myself) to communicate clear demand, and then on-line 3 set on the front end used as the cache ts suffix video files.Business clear, technical problems can only be done by themselves, before the squid with the new version of the performance is not, and the configuration cumbersome, I hav
Today debug Nginx A third-party purge cache module Proxy_cache_purge.During debugging, the cache already has data but it is not clear that the return is always 404.The last check for a long time, the reason for people three black lines ah.Original configuration at the beginningPut inAfter that.Change the order OK.However, the configuration was configured on the o
Gzip Compression OverviewWeb pages in the server side after gzip or other format of the compressed output significantly reduced content-length bytes, when the access to millions, these reduced bytes will become objective traffic to save, thereby reducing the pressure on the server and the speed of the Web page access;PrincipleWhen the client sends an HTTP request to the server, it has a accept-encoding header in the request header, which tells it what kind of compressed file it can receive from
What is the difference between the Varnish/squid/nginx cache? SQUID is the most comprehensive, but the architecture is too old, performance is not bad varnish is memory cache, speed first-class, but the memory cache also limits its capacity, cache pages and pictures are gene
Browser local cache, that is, when the browser loads a Web page, you can cache some of the content of the Web page, the local content will be loaded again, this can greatly improve the speed of access to the site. For the server side, this will also greatly save network resources.Browser caching relies on the Expires command output header to achieve:syntax: Expires [Time|epoch|max|off]Default value: Expires
Syntax: Expires [Time|epoch|max|off]Default value: Expires offScope: HTTP, server, locationUse this directive to control the headers of "Expires" and "Cache-control" in HTTP replies (as a function of controlling page caching).You can use a positive or negative number in the time value. The value of the "Expires" header is obtained by adding the time value you set for the current system.The epoch specifies a value of "Expires" of 1 January, 1970, 00:00
To automatically list directory configurations:
Download the open source software are aware that a very simple page lists all the versions of the source code, which is to open the automatic listing directory
The following configuration, in the virtual host location/{...} Configure automatic listing of directories in directory control:
Location/{
autoindex on;
}
Browser Local Cache settings:
The browser is to speed up browsing, the b
the position of the cursor to the first character of the article, to uppercase sometimes with vim, and then accidentally pressed a command, but did not find himself, and then has been the pit, NginxProxy_set_header X-real-ip $remote _addr;Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;Proxy_set_header host $host;Proxy_set_header X-nginx-proxy true;This piece all turned to lowercase do not know, and then the
Nginx can use Proxy_cache to cache files, you can queryHttp://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_pathHere's how:1. Proxy_cache_path Specifies the cache path, which is added in http:Proxy_cache_path/usr/local/ngin/proxy_cache levels=1:2 keys_zone=content:20m inactive=1d max_size=100m;/*levels Setting the directory hierarchyKeys_zone Sett
The principle of building image caching mechanism is to reduce the burden of database and speed up the response of static resources.Steps:1.vim/usr/local/nginx/conf/nginx.conf2.http{......#设置Web缓存区名称为cache_one,内存缓存空间大小为200MB,1天没有被访问的内容自动清除,硬盘缓存空间大小为30GBproxy_cache_path/var/imgcachetestlevels=1:2keys_zone=cache_one:200minactive=1dmax_size=30g;}Where/var/imgcachetest is the mkdir image cache directory. 3.serv
Browser cache is used to accelerate browsing and save network resources. The browser stores recently requested documents on the user's disk.
Nginx can use the expires command to set the browser header.
Syntax: expires [time | epoch | max | Off]
Default Value: expires off
Scope: HTTP, server, location
This command can be used to control the header labels of "expires" and "
In the beginning, the Nginx environment was built to realize the distributed cluster simply for load balancing. It is now possible to use the Nginx caching mechanism to optimize the corresponding speed. The following is a description of Nginx images, CSS, JS cache.#图片缓存时间设置location ~. *. (gif|jpg|jpeg|png|bmp|swf) ${ex
In the previous article, it was mentioned that the Nginx memcached module application scenario, mainly as a file cache. Then a problem is found, when large files are cached in a byte array, the cached data is compressed, which can cause problems when reading.(This article welcomes reprint, respect for others labor, reproduced please specify the Source: http://blog.csdn.net/poechant/article/details/7177603)T
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.