Someone is always asking what the cache uses, including varnish, squid, apache, and nginx. what architecture is the cache we use.
1. From these features. Varnish and squid are professional cache services, while apache and nginx are completed by third-party modules.
2. To use
Through the research of the configuration and deployment of high-performance Web server Nginx-(11) Application module of the memcached module of the two major scenarios of the article, we know how Nginx read data from memcached, if hit, then the efficiency is quite high. So:1. What if I don't hit it?We can read the data to the appropriate data server and then cache
Tags: remote incr undefined org read color comment led localhostNginx Errorsupstream Response Cache Error
*2470578 an upstream response are buffered to a temporary file/var/cache/nginx/proxy_temp/6/10/0000010106 while reading up Stream
To fixvim/etc/nginx/nginx.conf# in HTTP part of Nginx.confproxy_buffer
Traditionally,PHPused inmemcachemethod is to use thePhp-memcacheorphp-memachedExtended Operationsmemcache, inNginxThere are ways to build more efficient caching mechanisms. Is thatNginxDirect Accessmemcache, and useURIand theargswaitNginxbuilt-in variable setting cacheKeyrule, so that when the cache hits,Nginxcan skip throughfastcgiand thePHPthe process of communication, directly frommemcachegets the data and returns it. Memc-nginxand theSrcache-nginx
use the nginx proxy_store module to cache the obtained images in a local directory and directly call the module next time. (this makes statistics on hotspot images on webpages very easy, administrators who hate log analysis must like this)
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|html|htm|css)$ {log_not_found off;expires 7d ;access_log off;proxy_store on;proxy_store_access user:rw group:rw all:rw;if( !-
Varnish,nginx Building a cache serverI. Varnish1. Install the Pcre library, compatible with regular expressions# TAR-ZXVF Pcre-8.10.tar.gz# CD pcre-8.10#./configure--prefix=/usr/local/pcre# Make make install2. Configuring the Installation Varnish# TAR-ZXVF Varnish-3.0.2.tar.gz# CD varnish-3.0.2# Export pkg_config_path=/usr/local/pcre/lib/pkgconfig/#./configure--prefix=/usr/local/varnish# Make make install
Nginx + PHP Cache details Nginx cache
Nginx has two caching mechanisms: fastcgi_cache and proxy_cache.
Let's talk about the differences between the two cache mechanisms.
Proxy_cache is used to
Recently, in the development, found that the previous app client part of the page with WebView interaction, these pages request a lot, open a set of test paper, will produce 100+ request volume, resulting in system performance degradation. Consider doing a redis cache on the Nginx server closest to the client. Integrated the next web for the PHP cache data, after
The following is a detailed analysis of the PHP Cache in Nginx. For more information, see Nginx
Nginx cacheNginx has two caching mechanisms: fastcgi_cache and proxy_cache.Let's talk about the differences between the two cache mechanisms.Proxy_cacheThe function is to
This article brings to you the content is about Nginx configuration FastCGI Cache method Introduction, there is a certain reference value, the need for friends can refer to, I hope you have some help.
Caching mechanism
Nginx provides proxy-based and fastcgi-based caching methods, the instruction set is very similar, the use of the difference is not small. Becau
-forwarded-for $proxy _add_x_forwarded_for;
Proxy_pass http://mytest;
Add_header X-cache ' $upstream _cache_status from $host '; }
shell Script Cleanup
Can be cleared in batches, here is just the simplest script, there are many imperfections
#!/bin/bash
mfile= "$*"
Cache_dir=/etc/nginx/proxy_cache
echo $mfile
if ["$#"-eq 0]
Then echo "Please input scripts, if not, it'll exit"
s
Nginx CacheNginx has two kinds of caching mechanisms: Fastcgi_cache and Proxy_cache
Let's talk about the difference between the two caching mechanisms.Proxy_cacheThe role is to cache the contents of the backend server, which may be anything, including static and dynamic
Fastcgi_cacheThe role is to cache fastcgi generated content, in many cases, PHP generated dy
Tags: Socket HTTP Example CTI nbsp How to represent the maximumNginx's Open_file_cache-related configuration caches meta-information for static files and can significantly improve performance when these static files are accessed frequently.The cached file meta information includes:
FD, the file is opened once, and FD is reserved for use
Size
Path
Last Modified Time
...
Here is a sample configuration:Open_file_cache max=64 inactive=30d;open_file_cache_min_uses 8;open
first, add a hit display on the HTTP headerNginx provides $upstream_cache_status this variable to show the state of the cache, we can add an HTTP header in the configuration to display this state, to achieve similar squid effect.
1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Location / { proxy_redirect off; proxy_set_header host $host; proxy_set_header x-Real-ip $remote_addr; proxy_set_header X
Introduction: This cache setting uses the third-party module purge, the use of the source link and access to the specific content between the keyword "/purge/" can be added.Such as: access to Http://192.168.0.1/a.png will generate a.png cache files;You can erase the generated cache as long as you pass the http://192.168.0.1/purge/a.png.First, get the installation
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.