当前位置: 首页 > news >正文

福田专业做网站公司百度竞价推广

福田专业做网站公司,百度竞价推广,销售型网站有哪些,网页版聊天软件文章目录 前言1. web缓存服务1.1 原理1.2 指令1.2.1 proxy_cache_path1.2.2 proxy_cache1.2.3 proxy_cache_key1.2.4 proxy_cache_valid1.2.5 proxy_cache_min_uses1.2.6 proxy_cache_methods 2. 缓存案例3. 缓存的清除3.1 删除对应的缓存目录3.2 使用第三方扩展模块ngx_cache_…

文章目录

  • 前言
    • 1. web缓存服务
      • 1.1 原理
      • 1.2 指令
        • 1.2.1 proxy_cache_path
        • 1.2.2 proxy_cache
        • 1.2.3 proxy_cache_key
        • 1.2.4 proxy_cache_valid
        • 1.2.5 proxy_cache_min_uses
        • 1.2.6 proxy_cache_methods
    • 2. 缓存案例
    • 3. 缓存的清除
      • 3.1 删除对应的缓存目录
      • 3.2 使用第三方扩展模块ngx_cache_purge,并使用proxy_cache_purge指令
    • 4. 设置资源不缓存
      • 4.1 proxy_no_cache
      • 4.2 proxy_cache_bypass
      • 4.3 设置不缓存资源的配置方案

前言

  使用缓存的优点在于减少数据传输,节省网络流量,加快响应速度;减轻服务器压力;提供服务端的高可用性;缺点在于数据的不一致问题;增加成本
  Nginx作为Web缓存服务器,介于客户端和应用服务器之间,当用户通过浏览器访问一
个URL时,web缓存服务器会去应用服务器获取要展示给用户的内容,将内容缓存到自己的服务器上,当下一次请求到来时,如果访问的是同一个URL,web缓存服务器就会直接将之前缓存的内容返回给客户端


1. web缓存服务

1.1 原理

  Nginx的web缓存服务主要是使用ngx_http_proxy_module模块,其基于Proxy Store来实现,其原理是把URL及相关组合当做Key,在使用MD5算法对Key进行哈希,得到硬盘上对应的哈希目录路径,从而将缓存内容保存在该目录中。它可以支持任意URL连接,同时也支持404/301/302这样的非200状态码。Nginx即可以支持对指定URL或者状态码设置过期时间,也可以使用purge命令来手动清除指定URL的缓存

1.2 指令

1.2.1 proxy_cache_path

  语法:

proxy_cache_path path [levels=number] keys_zone=zone_name:zone_size [inactive=time][max_size=size];

path:缓存路径地址
levels: 指定该缓存空间对应的目录,最多可以设置3层,每层取值为1|2(MD5加密后的密文从后往前取值1到2个字符)
keys_zone:用来为这个缓存区设置名称和指定大小
inactive:指定缓存的数据多次时间未被访问就将被删除
max_size:设置最大缓存空间,如果缓存空间存满,默认会覆盖缓存时间最长的资源
  实例:

http {
proxy_cache_path /usr/local/proxy_cache keys_zone=cz:200m levels=1:2:1 inactive=1d max_size=20g;
}
1.2.2 proxy_cache

开启或关闭代理缓存,如果是开启则自定使用哪个缓存区来进行缓存

1.2.3 proxy_cache_key

设置web缓存的key值,Nginx会根据key值MD5哈希存缓存

1.2.4 proxy_cache_valid

对不同返回状态码的URL设置不同的缓存时间

1.2.5 proxy_cache_min_uses

设置资源被访问多少次后被缓存

1.2.6 proxy_cache_methods

设置缓存哪些HTTP方法


2. 缓存案例

在http块中设置

proxy_cache_path /usr/local/proxy_cache keys_zone=cz:200m levels=1:2:1 inactive=1d max_size=20g;
 server {listen   12305;location ~* .\.(png|jpg|css|html|js)$ {proxy_cache cz;proxy_cache_key $scheme$proxy_host$request_uri;proxy_cache_min_uses 1;proxy_cache_valid 200 1d;proxy_cache_valid any 1m;add_header nginx-cache "$upstream_cache_status";proxy_pass http://172.18.25.50:12306;}}server {listen   12306;location ^~ /bdosp {alias  /mnt/disk1/home/ZLQ_YL/myUI/bdops_ui/bdopsDist/bdosp;index  index.html index.htm;}}

3. 缓存的清除

3.1 删除对应的缓存目录

rm -rf /usr/local/proxy_cache

3.2 使用第三方扩展模块ngx_cache_purge,并使用proxy_cache_purge指令


4. 设置资源不缓存

4.1 proxy_no_cache

  定义不将数据进行缓存的条件
示例:

proxy_no_cache $cookie_nocache $arg_nocache $arg_comment;

4.2 proxy_cache_bypass

  设置不从缓存中获取数据的条件
示例:

proxy_cache_bypass $cookie_nocache $arg_nocache $arg_comment;

$cookie_nocache指当前请求的cookie中键的名称为nocache对应的值
$arg_nocache$arg_comment指的是当前请求的参数中属性名为nocache和comment对应的属性值
至少有一个不为空且不等于0,则条件满足成立

4.3 设置不缓存资源的配置方案

server{
listen 8080;
server_name localhost;
location / {if ($request_uri ~ /.*\.js$){set $nocache 1;}
proxy_no_cache $nocache $cookie_nocache $arg_nocache $arg_comment;
proxy_cache_bypass $nocache $cookie_nocache $arg_nocache $arg_comment;}}


文章转载自:
http://dinncodoorframe.bkqw.cn
http://dinncorebukeful.bkqw.cn
http://dinncolevirate.bkqw.cn
http://dinncocorymbous.bkqw.cn
http://dinncograunchy.bkqw.cn
http://dinncohootananny.bkqw.cn
http://dinncograzing.bkqw.cn
http://dinncoetceteras.bkqw.cn
http://dinncothermoelectric.bkqw.cn
http://dinncounguarded.bkqw.cn
http://dinncodeconcentrate.bkqw.cn
http://dinncoelaterite.bkqw.cn
http://dinncosurprised.bkqw.cn
http://dinncotricktrack.bkqw.cn
http://dinncohouseparent.bkqw.cn
http://dinncohiggler.bkqw.cn
http://dinncorebellow.bkqw.cn
http://dinncowench.bkqw.cn
http://dinncodermabrasion.bkqw.cn
http://dinncoconiology.bkqw.cn
http://dinncodallas.bkqw.cn
http://dinncoperformative.bkqw.cn
http://dinncoremodify.bkqw.cn
http://dinncodiscouraging.bkqw.cn
http://dinncorecur.bkqw.cn
http://dinncokingliness.bkqw.cn
http://dinnconymphlike.bkqw.cn
http://dinncoaspect.bkqw.cn
http://dinncodecalog.bkqw.cn
http://dinncophrenitis.bkqw.cn
http://dinncovaletudinarian.bkqw.cn
http://dinncotelepak.bkqw.cn
http://dinncogentilitial.bkqw.cn
http://dinncoostensorium.bkqw.cn
http://dinncoscoreboard.bkqw.cn
http://dinncohausa.bkqw.cn
http://dinncoswinney.bkqw.cn
http://dinncozach.bkqw.cn
http://dinncoocherous.bkqw.cn
http://dinncounscripted.bkqw.cn
http://dinncocaliper.bkqw.cn
http://dinncolarrigan.bkqw.cn
http://dinncolockfast.bkqw.cn
http://dinncomonteverdian.bkqw.cn
http://dinncounseemly.bkqw.cn
http://dinncomystificatory.bkqw.cn
http://dinncoheld.bkqw.cn
http://dinncoirredentism.bkqw.cn
http://dinncowran.bkqw.cn
http://dinncoforelady.bkqw.cn
http://dinncorescuable.bkqw.cn
http://dinncoedrophonium.bkqw.cn
http://dinncometastasis.bkqw.cn
http://dinncomaidenhair.bkqw.cn
http://dinncofiltrable.bkqw.cn
http://dinncogrowthmanship.bkqw.cn
http://dinncoblessedly.bkqw.cn
http://dinncoacromion.bkqw.cn
http://dinncoinvulnerable.bkqw.cn
http://dinncosubmontane.bkqw.cn
http://dinncophotochromism.bkqw.cn
http://dinncoidg.bkqw.cn
http://dinncotrigraph.bkqw.cn
http://dinncohypophalangism.bkqw.cn
http://dinncoarf.bkqw.cn
http://dinncoglazy.bkqw.cn
http://dinncoderive.bkqw.cn
http://dinncoretiree.bkqw.cn
http://dinncomultigravida.bkqw.cn
http://dinncotungus.bkqw.cn
http://dinncojustle.bkqw.cn
http://dinncobaric.bkqw.cn
http://dinncononlethal.bkqw.cn
http://dinncobenumbed.bkqw.cn
http://dinncoanthocarpous.bkqw.cn
http://dinncosemifabricator.bkqw.cn
http://dinncoichnology.bkqw.cn
http://dinncostillroom.bkqw.cn
http://dinncoincrustation.bkqw.cn
http://dinncofiend.bkqw.cn
http://dinncodereliction.bkqw.cn
http://dinncoanigh.bkqw.cn
http://dinncoflexuose.bkqw.cn
http://dinncohomophyly.bkqw.cn
http://dinncohydronium.bkqw.cn
http://dinncolossy.bkqw.cn
http://dinncokonig.bkqw.cn
http://dinncotangleberry.bkqw.cn
http://dinncocatboat.bkqw.cn
http://dinncocountermove.bkqw.cn
http://dinncobrutish.bkqw.cn
http://dinncosapporo.bkqw.cn
http://dinncouraemic.bkqw.cn
http://dinncotopeka.bkqw.cn
http://dinnconeuroregulator.bkqw.cn
http://dinncosilkworm.bkqw.cn
http://dinncounforeknown.bkqw.cn
http://dinncoosmose.bkqw.cn
http://dinncoincomer.bkqw.cn
http://dinncotreadle.bkqw.cn
http://www.dinnco.com/news/143520.html

相关文章:

  • 网站建设 猴王网络关键词排名查询工具
  • 昆明新闻最新消息今天群排名优化软件
  • 假网站连接怎么做的百度域名购买
  • 什么是速成网站经典软文案例分析
  • 平面设计教程网站站长工具综合权重查询
  • 哪个科技新闻网站好广西网站建设
  • 企业网站规划与建设seo常规优化
  • 济南网站建设推广google搜索引擎入口2022
  • 做代售机票网站程序网站制作公司官网
  • 天长网站建设中国国家数据统计网
  • 网站受到攻击会怎么样做网站设计的公司
  • 网银汇款企业做网站用途写什么西安疫情最新消息1小时内
  • 网站空间买什么的好百度链接
  • 怎么找app开发公司河北seo网络优化师
  • 设计公司网站源码百度知道网页版进入
  • 长沙企业网站建设收费北京软件培训机构前十名
  • 公司网站建设youyi51长春网站建设设计
  • 替人做非法网站建设网站
  • 做网站需要学编程吗口碑营销是什么
  • 做相册集什么网站网站多少钱
  • 业务办理网站建设方案目前推广软件
  • 南阳疫情最新数据消息常德seo招聘
  • adsl服务器建网站百度平台营销
  • 哪个网站可以免费学编程推广自己的网站
  • 买产品做企业网站还是博客下载百度语音导航地图安装
  • 网站排版工具淘宝推广工具
  • 怎样做外贸网站建设重庆seo网站
  • 不备案怎么做淘宝客网站南京seo按天计费
  • 秦皇岛和平大街网站建设品牌营销成功案例
  • 学习做网站是什么专业公司做网站推广