Skip to content

Commit f2fbeb9

Browse files
authored
Merge pull request #326 from FriendsOfSymfony/simplify-hits
Simplify hits counting
2 parents 1c7d663 + 07cc5d7 commit f2fbeb9

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

resources/config/varnish-3/fos_debug.vcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
sub fos_debug_deliver {
11-
# Add extra headers if debugging is enabled
11+
# Add X-Cache header if debugging is enabled
1212
if (resp.http.X-Cache-Debug) {
1313
if (obj.hits > 0) {
1414
set resp.http.X-Cache = "HIT";

resources/config/varnish/fos_debug.vcl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@
88
*/
99

1010
sub fos_debug_deliver {
11-
# Add extra headers if debugging is enabled
12-
# In Varnish 4 the obj.hits counter behaviour has changed, so we use a
13-
# different method: if X-Varnish contains only 1 id, we have a miss, if it
14-
# contains more (and therefore a space), we have a hit.
11+
# Add X-Cache header if debugging is enabled
1512
if (resp.http.X-Cache-Debug) {
16-
if (resp.http.X-Varnish ~ " ") {
13+
if (obj.hits > 0) {
1714
set resp.http.X-Cache = "HIT";
1815
} else {
1916
set resp.http.X-Cache = "MISS";

0 commit comments

Comments
 (0)