nginx代理缓存设置

高速电路的信号完整性分析 摘要:介绍了高速PCB设计中的信号完整性概念以及破坏信号完整性的原因,从理论和计算的层面上分析了高速电路设计中反射和串扰的形成原因,并介绍了IBIS仿真。 关键词:信号完整性 反射 串扰 IBIS仿真 随着半导体技术和深压微米工艺的不断发展,IC的开关速度目前已经从几十MHz增加到几百MHz,甚至达到几GHz。在高速PCB设计中,工程师经常会碰到误触发、阻尼振荡、过冲、欠冲、串... 阅读详情

(1)缓存介绍

1.代理服务器端缓存作用
减少后端压力,提高网站并发延时
2.缓存常见类型
服务器端缓存:代理缓存,获取服务器端内容进行缓存
浏览器端缓存
3.nginx代理缓存:proxy_cache

(2)代理缓存配置

1.缓存配置

#vim /usr/local/nginx/conf/nginx.conf 
upstream node {
    server 192.9.191.31:8081;
    server 192.9.191.31:8082;
}
proxy_cache_path /cache levels=1:2 keys_zone=cache:10m max_size=10g inactive=60m use_temp_path=off;
server {
    listen 80;
    server_name www.test.com;
    index index.html;
    location / {
    proxy_pass http://node;
    proxy_cache cache;
    proxy_cache_valid   200 304 12h;
    proxy_cache_valid   any 10m;
    add_header  Nginx-Cache "$upstream_cache_status";
    proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
        }
    }

2.参数详解

proxy_cache_path /soft/cache levels=1:2 keys_zone=cache:10m max_size=10g inactive=60m use_temp_path=off;
    #proxy_cache    //存放缓存临时文件
    #levels         //按照两层目录分级
    #keys_zone      //开辟空间名,10m:开辟空间大小,1m可存放8000key
    #max_size       //控制最大大小,超过后Nginx会启用淘汰规则
    #inactive       //60分钟没有被访问缓存会被清理
    #use_temp_path  //临时文件,会影响性能,建议关闭
proxy_cache cache;
proxy_cache_valid   200 304 12h;
proxy_cache_valid   any 10m;
add_header  Nginx-Cache "$upstream_cache_status";
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
    #proxy_cache            //开启缓存
    #proxy_cache_valid      //状态码200|304的过期为12h,其余状态码10分钟过期
    #proxy_cache_key        //缓存key
    #add_header             //增加头信息,观察客户端respoce是否命中
    #proxy_next_upstream    //出现502-504或错误,会跳过此台服务器访问下一台服务器


3.创建缓存目录

mkdir /cache 
nginx -t 
nginx -s reload 

4.验证

(3)清除缓存

1.rm删除已缓存的数据
rm -rf /cache/*
2.通过ngx_cache_purge扩展模块清理,需要编译安装nginx

(4)部分页面不缓存

1.nginx配置

#vim /usr/local/nginx/conf/nginx.conf 
upstream node {
        server 192.9.191.31:8081;
        server 192.9.191.31:8082;
}
proxy_cache_path /cache levels=1:2 keys_zone=cache:10m max_size=10g inactive=60m use_temp_path=off;
server {
        listen 80;
        server_name www.test.com;
        index index.html;
        if ($request_uri ~ ^/(static|login|register|password)) {
                set $cookie_nocache 1;
                }
        location / {
                proxy_pass http://node;
                proxy_cache     cache;
                proxy_cache_valid       200 304 12h;
                proxy_cache_valid       any     10m;
                add_header      Nginx-Cache     "$upstream_cache_status";
                proxy_next_upstream     error timeout invalid_header http_500 http_502 http_503 http_504;
                proxy_no_cache $cookie_nocache $arg_nocache $arg_comment;
                proxy_no_cache $http_pargma $http_authorization;
                }
        }


2.重启加验证

nginx -t 
nginx -s reload 

两次都没有命中

(4)统计日志命中率

1.日志格式:变量$upstream_cache_status"

#vim /usr/local/nginx/conf/nginx.conf       
log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for" "$upstream_cache_status"';
access_log logs/access.log main;
error_log logs/error.log;

2.查看日志

3.统计日志命中率加入到计划任务中这里省略

awk '{if($NF = "HIT"){count++;}} END{printf "%.2f%",count/NR*100}' /usr/local/nginx/logs/access.log
以太网测试用例(光模块线缆、网卡类设备、交换类设备) LeCroy力科网络测试相关的测试用例分享:光模块/DAC/ACC/AEC/AOC测试,网卡类产品测试/GPU/DPU/SmartNIC,交换类产品测试。涉及物理层的FEC,SKEW,Tx/Rx Taps和Layer23层的网络性能测试/吞吐量延迟抖动丢包率背靠背性能,以及RDMA带状况的网络协议分析。同步提供400G高速的以太网的损伤,提供定量,可重复的负面压力测试环境。 阅读详情

相关推荐

AR-HMM模型 自回归隐马尔可夫模型

AR-HMM模型 自回归隐马尔可夫模型 数据处理过程 输入的视频数据首先需要被裁剪以适合动物的大小,在这之后考虑到模型建立的目的为行为状态的分类,于是需要消除可能一帧里带有多个动作状态的行为成分,这个过程也就是对帧。对帧之后我们的为了适应模型训练还需要对每一帧的数据进行小波分解(类似傅里叶变换的信号重构),此时数据预处理阶段完成。 信号重构后的数据拥有的特征维度过多,因此需要应用主成分分析法(PCA)来选出对于分类结果贡献度最高的前十个分类特征。至此自回归隐马尔可夫模型的准备工作就完成了。 AR-HMM自

weixin_46263718的博客 2284

nginx代理缓存

(1)缓存介绍 1.代理服务器端缓存作用 减少后端压力,提高网站并发延时 2.缓存常见类型 服务器端缓存:代理缓存,获取服务器端内容进行缓存 浏览器端缓存 3.nginx代理缓存:proxy_cache (2)代理缓存配置 1.缓存配置 #vim /usr/local/nginx/conf/nginx.conf upstream node { server 192.9.191.31:80...

weixin_30471065的博客 252

把群晖NAS变成游戏开发服务器:Perforce与虚幻引擎深度整合的5个关键配置(含.p4ignore模板)

本文详细介绍了如何将群晖NAS配置为游戏开发服务器,重点讲解了Perforce与虚幻引擎的深度整合。通过五个关键配置节点,包括用户权限架构、Workspace策略、资产同步优化、仓库清洁度保障和编辑器深度集成,帮助小型团队打造高效开发环境。文章还提供了实用的.p4ignore模板和优化技巧,显著提升开发效率。

weixin_30430677的博客 318

服务(第三十二篇)nginx做缓存服务器

nginx的缓存代理服务器!!!

Y_ht1209的博客 1913

3D Slicer-最强大的开源医学图像分割工具简要概述

3D Slicer 是一个免费的开源软件平台,用于医学、生物医学和其他 3D 图像的可视化、处理、分割、配准和分析。读/写DICOM图像和多种其他格式;三维图像、多边形网格和体积渲染的交互式可视化;手动编辑和标记图像;使用刚性和非刚性算法融合和共同配准数据;图像自动分割;跟踪图像引导程序的设备。所有的功能模块可在工具栏里找到,提供搜索,下拉选择,左右切换等功能。3D slicer的大概情况就介绍到这里。它的功能非常强大,也没有必要说掌握每个功能的使用。

Tina姐的博客 2万+

Cursor+Apifox MCP Server实战:5分钟搞定API自动化测试用例生成

本文详细介绍了如何利用Cursor IDE与Apifox MCP Server,在5分钟内将API文档自动转化为高质量的自动化测试用例。通过配置MCP Server建立数据桥梁,开发者可直接用自然语言指令,让AI基于真实接口规范生成可立即执行的pytest测试代码,大幅提升接口测试效率,特别适合快节奏的SaaS项目。

ooo22的博客 534

nginx proxy_cache 配置

使用Nginx的proxyCache缓存功能 Nginx从0.7.48版本开始,支持了类似Squid的缓存功能。这个缓存是把URL及相关组合当作Key,用md5编码哈希后保存在硬盘上,所以它可以支持任意URL链接,同时也支持404/301/302这样的非200状态码。虽然目前官方的Nginx Web缓存服务只能为指定URL或状态码设置过期时间,不支持类似Squid的PURGE指令,手动清

我是山寨南侠 828

[Ethernet in CANoe]3--CANoe工程中SOME/IP报文的详细介绍(一)

和上述第一章节的介绍,我们对SOEMIP通信协议有了初步了解,首先我们先暂停Trace窗口,可以看到整个Trace窗口关于SOMEIP的报文有两种颜色,一种是紫色,另一种是绿色。它使用多播地址,允许服务提供者发布其服务,服务消费者订阅这些服务。上述每点开一个SOMEIP报文,左侧的details就能看到该报文中的具体细节,从IP地址到port口,再到具体的serviceID,都能详细的解析。一旦通过服务发现完成了服务的发布和订阅,服务消费者就可以向服务提供者发送请求,或者服务提供者向消费者发送事件通知。

汽车ECU自动化测试 1412

Nginx使用proxy_cache指令设置反向代理缓存静态资源

参考上面流程实现搭建Nginx的基础上,实现静态资源的缓存设置。注意上面安装时的目录是在/opt/nginx目录下,这里是在/usr/local/nginx目录下。

BADAO_LIUMANG_QIZHI的博客 4495

基于Simulink的永磁同步电机力位混合控制(导纳+位置)仿真

本文详细介绍了基于Simulink的永磁同步电机(PMSM)力位混合控制系统实现方法。主要内容包括:1) 通过导纳控制原理(二阶质量-阻尼-弹簧模型)实现机器人柔顺控制;2) 在Simulink中构建虚拟环境、导纳控制器、PMSM驱动系统等完整框架;3) 针对曲面恒力打磨场景,实现20N恒力跟踪(RMS误差1.2N)和位置顺应;4) 支持纯位置/导纳/恒力三种工作模式切换;5) 提供系统性能评估指标和高级扩展功能。该方案显著提升了机器人环境交互的安全性和适应性,适用于精密装配、人机协作等应用场景。

xiaoheshang_123的博客 147

库存优化技术提升电商效率

第一部分:库存优化技术基础 第1章:库存优化的基本概念 库存优化是现代电商运营中至关重要的一个环节。简单来说,库存优化指的是通过一系列的策略和技术手段,使得库存管理更加高效、准确,从而降低运营成本,提高销售额。 1.1 库存优化的定义与重要性

AI天才研究院 1248

重读Nginx缓存proxy_cache一些细节参数

Nginx缓存粗犷强大。动态数据静态化。即使服务挂了,只有服务器没有宕机,也能命中缓存。 nginx version: nginx/1.11.4 location ~* ^/apicenter/(v3\.goods\.getList|) { proxy_cache cache_one; proxy_cache_valid 200 30...

fsstyle的专栏 3089

基于方差分解分析气象/水文干旱驱动因素(含MATLAB全代码)

简介基于方差分解方法分析气象/水文干旱驱动因素

WW、forever的博客 801

Nginx的代理缓存设置

Nginx的代理缓存设置 语雀Q群 763215167 expires: 设置浏览器的缓存时间 (客户端缓存) location /files { alias /home/imooc; # expires 10s; 缓存10秒 # expires @23h45m; 设置当前时间到23:45的时间点的时间戳,就算缓存时间差 # expires -1h; 当前时间-1小时过期,就算已经过期了 # expires epoch; 表示缓存在 1970,00:00

qq_43338943的博客 768

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

Nginx Proxy如何设置代理和proxy代理缓存

一:nginx proxy设置代理 代理的模块式:ngx_http_proxy_module 代理 Syntax: proxy_pass URL; 代理的后端服务器URL Default: — Context: location, if in location, limit_except 缓冲区 Syntax: proxy_buffering on | off; Default: proxy_bufferin...

nacysummer的博客 2060

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

在Nginx中设置反向代理缓存

背景 在项目中,有些产品介绍类图片、文档会存储到hdfs中,但hdfs的存取速度比较慢,不能满足互联网用户的要求,这里就使用缓存方式,将不经常变化文件缓存到nginx代理服务器,以减少HDFS的读取次数,提高用户访问速度。 Nginx缓存原理 缓存技术的基本思想其实是对用户已经访问过的内容在Nginx建立副本,如果在一段时间内(缓存尚未过期)再次访问该数据,则不需要重新发起请求获取数据,可以直接从...

buxin_2008的专栏 1391

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

NGINX方向代理 设置浏览器缓存 nginx本地缓存

反向代理时启用nginx本地缓存。

球球的博客 383

Nginx缓存以及反向代理缓存设置

expires指令 (1).expires [time] server { listen 90; server_name localhost; location /czj { root /home; expires 10s ; } } 在location模块中配置expires 表示缓存的失效时间为10s . (2). expires @[time] se

m0_50805484的博客 2703

Nginx设置无缓存反向代理教程

在/www/server/nginx/conf目录下,修改proxy.conf为如下内容。如需https可进行Let’Encypt的DNS验证,选择手动解析,点击自动组合泛域名;本文是Nginx设置无缓存反向代理教程,花了200块钱学习到的知识。点击反向代理,添加反向代理,输入需要代理的域名,点击提交;您需要代理的域名,后面不需要反斜杠/;做完一切后记得重启Nginx加载配置;第一步:修改nginx配置。第二步:增加ssl*第三步:设置反向代理。

winkexin的博客 1011

nginx如何代理静态文件和设置浏览器缓存有效期

记录nginx如何代理静态文件并设置浏览器的缓存和有效期, 浏览器缓存静态文件后, 相同的请求就会直接读取缓存, 从而节省带宽和开销

青春沐谷的博客 2986

Centos7笔记之nginx充当代理服务器并设置缓存04

一、目标 centos7下的nginx充当代理服务器并设置代理缓存(无坑版) 二、平台 [root@xserver ~]# cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core) [root@centos764 conf.d]# nginx -V nginx version: nginx/1.16.1 三、解析 1....

潇洒哥的运维之道 772

Nginx反向代理和缓存设置

A服务器:192.168.0.1 (前端代理服务器) B服务器:192.168.0.2(后端主服务器) 原理:用户访问一个www.xx.com域名,DNS指向代理服务器A,代理服务器根据域名本地查找有没有记录,如果有直接返回信息,没有,则将请求发给后端主服务器,后端服务器处理完将数据发给代理服务器,代理服务器将数据发给客户端。 代理服务器A:nginx.conf配...

weixin_34376986的博客 118

设置nginx代理和缓存

安装nginx nginx下载地址:nginx 进入到安装的目录 cd d/nginx-1.14.0 启动nginx ./nginx.exe 浏览器中输入localhost查看有么有安装成功 进入到文件夹D:\nginx-1.14.0\conf,找到nginx.conf文件 打开nginx.conf在此处添加include指令代码导入配置 再到根目录下创建servers文件夹 在ser...

weixin_41362657的博客 212

动态PHP电商网站伪静态的Nginx反向代理Cache缓存终级设置

​背景介绍: 最近为电子商务网站 www.XinXiLan.online 新西兰购物网 设置伪静态和Nginx反向代理cache缓存,进过长时间的调试,终于达到比较满意的效果,这里把实战经验分享给大家,希望对新人有所帮助,能节约大家的一些时间。文章中有连接到真实配置的网站 www.XinXiLan.online 新西兰购物网 转载请保留此连接,本文章中所有达到的效果,都可以到 www.XinX...

xinxilan100的博客 1171

nginx设置反向代理缓存

# proxy_cache_path 设置缓存保存的目录 # keys_zone 设置共享内存以及占用大小 # max_size 设置缓存大小 # inactive 超过此时间缓存自动清理 # use_temp_path 关闭临时配置 proxy_cache_path /user/local/nginx/my_cache keys_zone=mycache:5m max_size=2g inactive=8h use_temp_path=off; server { ... # 开启并使用缓存 pro

赛赛 253

使用Nginx压缩文件、设置反向代理缓存提高响应速度

Gzip压缩: 最开始,这个竟然要6m多(大到不寻常),响应的速度3分多钟。 所以先对返回的文件进行gzip压缩。判断返回的资源是否有使用gzip压缩,观察响应头部里面,如果没有 Content-Encoding: gzip;这意味着文件是在没有压缩的情况下提供。 在nginx.conf中进行如下配置: http{ .... #使用gzip压缩; gzi...

HuiL的博客 1643
上一篇: HTTP缓存SpringMVC实现
下一篇: Centos7环境下搭建Nginx+Lua+Redis进行数据存取
低调的杉菜
博客等级 码龄15年 12粉丝 34原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值