Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
9e174d4c
Commit
9e174d4c
authored
Mar 06, 2018
by
Guillaume Quintard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log cacheability
parent
b3691b39
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
21 deletions
+33
-21
cache_rfc2616.c
bin/varnishd/cache/cache_rfc2616.c
+3
-2
cache_vrt.c
bin/varnishd/cache/cache_vrt.c
+1
-1
cache_vrt_var.c
bin/varnishd/cache/cache_vrt_var.c
+11
-2
vsl_tags.h
include/tbl/vsl_tags.h
+18
-16
No files found.
bin/varnishd/cache/cache_rfc2616.c
View file @
9e174d4c
...
...
@@ -198,9 +198,10 @@ RFC2616_Ttl(struct busyobj *bo, double now, double *t_origin,
}
VSLb
(
bo
->
vsl
,
SLT_TTL
,
"RFC %.0f %.0f %.0f %.0f %.0f %.0f %.0f %u"
,
"RFC %.0f %.0f %.0f %.0f %.0f %.0f %.0f %u
%s
"
,
*
ttl
,
*
grace
,
*
keep
,
now
,
*
t_origin
,
h_date
,
h_expires
,
max_age
);
*
t_origin
,
h_date
,
h_expires
,
max_age
,
bo
->
uncacheable
?
"uncacheable"
:
"cacheable"
);
}
/*--------------------------------------------------------------------
...
...
bin/varnishd/cache/cache_vrt.c
View file @
9e174d4c
...
...
@@ -105,7 +105,7 @@ VRT_hit_for_pass(VRT_CTX, VCL_DURATION d)
oc
->
ttl
=
d
;
oc
->
grace
=
0
.
0
;
oc
->
keep
=
0
.
0
;
VSLb
(
ctx
->
vsl
,
SLT_TTL
,
"HFP %.0f %.0f %.0f %.0f"
,
VSLb
(
ctx
->
vsl
,
SLT_TTL
,
"HFP %.0f %.0f %.0f %.0f
uncacheable
"
,
oc
->
ttl
,
oc
->
grace
,
oc
->
keep
,
oc
->
t_origin
);
}
...
...
bin/varnishd/cache/cache_vrt_var.c
View file @
9e174d4c
...
...
@@ -229,8 +229,11 @@ VRT_r_bereq_uncacheable(VRT_CTX)
VCL_VOID
VRT_l_beresp_uncacheable
(
VRT_CTX
,
VCL_BOOL
a
)
{
struct
objcore
*
oc
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
bo
,
BUSYOBJ_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
bo
->
fetch_objcore
,
OBJCORE_MAGIC
);
if
(
ctx
->
bo
->
uncacheable
&&
!
a
)
{
VSLb
(
ctx
->
vsl
,
SLT_VCL_Error
,
...
...
@@ -238,6 +241,11 @@ VRT_l_beresp_uncacheable(VRT_CTX, VCL_BOOL a)
}
else
if
(
a
)
{
ctx
->
bo
->
uncacheable
=
1
;
}
oc
=
ctx
->
bo
->
fetch_objcore
;
VSLb
(
ctx
->
vsl
,
SLT_TTL
,
"VCL %.0f %.0f %.0f %.0f %s"
,
\
oc
->
ttl
,
oc
->
grace
,
oc
->
keep
,
oc
->
t_origin
,
\
ctx
->
bo
->
uncacheable
?
"uncacheable"
:
"cacheable"
);
\
}
VCL_BOOL
...
...
@@ -598,8 +606,9 @@ VRT_l_##which##_##fld(VRT_CTX, VCL_DURATION a) \
if (a < 0.0) \
a = 0.0; \
oc->fld = a; \
VSLb(ctx->vsl, SLT_TTL, "VCL %.0f %.0f %.0f %.0f", \
oc->ttl, oc->grace, oc->keep, oc->t_origin); \
VSLb(ctx->vsl, SLT_TTL, "VCL %.0f %.0f %.0f %.0f %s", \
oc->ttl, oc->grace, oc->keep, oc->t_origin, \
ctx->bo->uncacheable ? "uncacheable" : "cacheable");\
}
#define VRT_DO_EXP_R(which, oc, fld, offset) \
...
...
include/tbl/vsl_tags.h
View file @
9e174d4c
...
...
@@ -209,25 +209,27 @@ SLTM(LostHeader, 0, "Failed attempt to set HTTP header",
SLTM
(
TTL
,
0
,
"TTL set on object"
,
"A TTL record is emitted whenever the ttl, grace or keep"
" values for an object is set.
\n\n
"
" values for an object is set as well as whether the object is "
" cacheable or not.
\n\n
"
"The format is::
\n\n
"
"
\t
%s %d %d %d %d [ %d %d %u %u ]
\n
"
"
\t
| | | | | | | | |
\n
"
"
\t
| | | | | | | | +- Max-Age from Cache-Control header
\n
"
"
\t
| | | | | | | +---- Expires header
\n
"
"
\t
| | | | | | +------- Date header
\n
"
"
\t
| | | | | +---------- Age (incl Age: header value)
\n
"
"
\t
| | | | +--------------- Reference time for TTL
\n
"
"
\t
| | | +------------------ Keep
\n
"
"
\t
| | +--------------------- Grace
\n
"
"
\t
| +------------------------ TTL
\n
"
"
\t
+---------------------------
\"
RFC
\"
,
\"
VCL
\"
or
\"
HFP
\"\n
"
"
\t
%s %d %d %d %d [ %d %d %u %u ] %s
\n
"
"
\t
| | | | | | | | | |
\n
"
"
\t
| | | | | | | | | +-
\"
cacheable
\"
or
\"
uncacheable
\"\n
"
"
\t
| | | | | | | | +------ Max-Age from Cache-Control header
\n
"
"
\t
| | | | | | | +--------- Expires header
\n
"
"
\t
| | | | | | +------------ Date header
\n
"
"
\t
| | | | | +--------------- Age (incl Age: header value)
\n
"
"
\t
| | | | +-------------------- Reference time for TTL
\n
"
"
\t
| | | +----------------------- Keep
\n
"
"
\t
| | +-------------------------- Grace
\n
"
"
\t
| +----------------------------- TTL
\n
"
"
\t
+--------------------------------
\"
RFC
\"
,
\"
VCL
\"
or
\"
HFP
\"\n
"
"
\n
"
"The
last four
fields are only present in
\"
RFC
\"
headers.
\n\n
"
"The
four optional
fields are only present in
\"
RFC
\"
headers.
\n\n
"
"Examples::
\n\n
"
"
\t
RFC 60 10 -1 1312966109 1312966109 1312966109 0 60
\n
"
"
\t
VCL 120 10 0 1312966111
\n
"
"
\t
HFP 2 0 0 1312966113
\n
"
"
\t
RFC 60 10 -1 1312966109 1312966109 1312966109 0 60
cacheable
\n
"
"
\t
VCL 120 10 0 1312966111
uncacheable
\n
"
"
\t
HFP 2 0 0 1312966113
uncacheable
\n
"
"
\n
"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment