variable
some global variable are avaliable in subroutings, in different stage there are different variable avaliable,
ref: https://www.varnish-cache.org/docs/3.0/reference/vcl.html#subroutines
------
set variable value
keyword 'set', is used to set value of variable,
format:
set xxx = yyy;
------
unset / remove header
keyword 'unset' or 'remove' (the same), are used to remove value of variable,
format:
unset xxx;
remove xxx;
------
variable - always avaliable
* now
current time in seconds,
*
------
variable - in backend declaration
* .host
hostname or ip
* .port
port number or service name
*
------
variable - while processing request
* client.ip
* client.identity
Identification of the client, used to load balance in the client director.
*
* server.hostname
* server.identity
* server.ip
* server.port
*
* req.request
request type,
e.g:
"GET" , "POST" , "HEAD"
* req.url
the requested url,
* req.proto
http protocol version used by the client,
* req.backend
the backend used to serve this request
* req.healthy
Whether the backend is healthy or not. Requires an active probe to be set on the backend.
* req.http.header
http headers,
* req.hash_always_miss
Force a cache miss for this request. If set to true Varnish will disregard any existing objects and always (re)fetch from the backend.
* req.hash_ignore_busy
Ignore any busy object during cache lookup, may avoid deadlock,
* req.can_gzip
whether the client support gzip,
* req.restarts
restart counter
* req.esi
boolean, whether enable ESI,
* req.esi_level
* req.grace
* req.xid
unique id for this request,
*
------
variable - while preparing a backend request (cache miss / pass / pipe)
* bereq.request
request type,
e.g:
"GET" , "POST" , "HEAD"
* bereq.url
requested url,
* bereq.proto
http protocol version,
* bereq.http.header
http headers,
*
* bereq.connect_timeout
The time in seconds to wait for a backend connection.
* bereq.first_byte_timeout
The time in seconds to wait for the first byte from the backend. Not available in pipe mode.
* bereq.between_bytes_timeout
The time in seconds to wait between each received byte from the backend. Not available in pipe mode.
*
------
variable - after retrieve from backend & before enter cache (vcl_fetch)
* beresp.do_stream
Deliver the object to the client directly without fetching the whole object into varnish. If this request is pass'ed it will not be stored in memory.
* beresp.do_esi
boolean, whether ESI-process the object after fetching it, default to false,
* beresp.do_gzip
boolean, whether do gzip before storing it, default to false,
* beresp.do_gunzip
boolean, whether do unzip before storing it, default to false,
* beresp.proto
http protocol version
* beresp.status
http status code returned by server,
* beresp.response
http status message returned by server,
* beresp.ttl
ttl of the object, writable,
*
* beresp.grace
set a period to enable grace,
* beresp.saintmode
set a period to enable saint mode,
*
* beresp.backend.name
* beresp.backend.ip
* beresp.backend.port
*
* beresp.storage
force varnish to store this object to a particular backend storage,
*
------
variable - after enter cache (vcl_hit / vcl_deliver / ..)
* obj.proto
* obj.status
http status code
* obj.response
http status message
* obj.ttl
* obj.lastuse
the about time passed since last use of this object, in seconds,
* obj.hits
the about times of this object has been delivered, 0 means cache miss,
* obj.grace
* obj.http.header
*
------
variable - while determining the hash key of an object
* req.hash
the hash key of this object, used when reading from and writing to the cache,
*
------
variable - while preparing a response to the client
* resp.proto
* resp.status
* resp.response
* resp.http.header
*
------
分享到:
相关推荐
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
Ansible-ansible-role-varnish.zip,ansible role-varnish http加速敏感角色:varnish,ansible是一个简单而强大的自动化引擎。它用于帮助配置管理、应用程序部署和任务自动化。
官方离线安装包,亲测可用。使用rpm -ivh [rpm完整包名] 进行安装
laravel-varnish, 使 varnish 和 Laravel 在一起很好 使 varnish 和 Laravel 在一起很好 这个包提供了一个简单的方法,可以在 Laravel 中使用 varnish 4 ( 或者 5 ) 。 它提供了路由中间件,在应用到路由时,将确保 ...
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
Linux Varnish 配置详解 Varnish 是一款高性能的开源HTTP缓存和代理服务器,主要用于提升网站的响应速度和处理能力。它通过缓存静态内容和动态内容的副本,减少对后端服务器的请求,从而提高了整体的Web性能。在...