Skip to content

action=never-cache did NOT take effect in cache.config #1329

Closed

Description

@ling-zhou

version: trafficserver-7.0.0-rc2
testing URL: curl -v http://test.com:65432/data/1.php

first try:
################### cache.config #####################
dest_domain=test.com suffix=php action=never-cache cache-responses-to-cookies=0 #1
dest_domain=test.com suffix=jsp action=never-cache cache-responses-to-cookies=0 #2
dest_domain=test.com suffix=asp action=never-cache cache-responses-to-cookies=0 #3
dest_domain=test.com suffix=aspx action=never-cache cache-responses-to-cookies=0 #4
dest_domain=test.com suffix=ts ttl-in-cache=3s cache-responses-to-cookies=1 #5
dest_domain=test.com suffix=m3u8 ttl-in-cache=2s cache-responses-to-cookies=1 #6
dest_domain=test.com ttl-in-cache=4s cache-responses-to-cookies=0 #7
################### traffic.out #####################
[Jan 17 11:45:44.038] Server {0x2b309a30d700} DEBUG: <CacheControl.cc:466 (UpdateMatch)> (cache_control) Matched with for NEVER_CACHE at line 1 [cache-responses-to-cookies=0]
[Jan 17 11:45:44.038] Server {0x2b309a30d700} DEBUG: <CacheControl.cc:466 (UpdateMatch)> (cache_control) Matched with for TTL_IN_CACHE at line 7 [cache-responses-to-cookies=0]
##################### problem #######################
I expected rule #1, but rule #7 took effect.

second try:
################### cache.config #####################
dest_domain=test.com ttl-in-cache=4s cache-responses-to-cookies=0 #1
dest_domain=test.com suffix=php action=never-cache cache-responses-to-cookies=0 #2
dest_domain=test.com suffix=jsp action=never-cache cache-responses-to-cookies=0 #3
dest_domain=test.com suffix=asp action=never-cache cache-responses-to-cookies=0 #4
dest_domain=test.com suffix=aspx action=never-cache cache-responses-to-cookies=0 #5
dest_domain=test.com suffix=ts ttl-in-cache=3s cache-responses-to-cookies=1 #6
dest_domain=test.com suffix=m3u8 ttl-in-cache=2s cache-responses-to-cookies=1 #7
################### traffic.out #####################
[Jan 17 12:01:44.553] Server {0x2b521db00700} DEBUG: <CacheControl.cc:466 (UpdateMatch)> (cache_control) Matched with for TTL_IN_CACHE at line 1 [cache-responses-to-cookies=0]
##################### problem #######################
I expected rule #2, but rule #1 took effect.

Activity

  1. garfieldonly commented on Mar 21, 2019

    @garfieldonly
    Contributor

    According to the codes, it seems that the ttl-in-cache has higher priority than never-cache.
    Actually,ats has an another bug here, sometimes ttl-in-cache doest not override new-cache,

  2. added this to the 10.0.0 milestone on May 22, 2019
  3. rob05c commented on Apr 12, 2021

    @rob05c
    Member

    This is working as documented: https://docs.trafficserver.apache.org/en/7.1.x/admin-guide/files/cache.config.en.html#matching-multiple-rules

    When multiple rules are specified in cache.config, Traffic Server will check all of them in order for each request. Thus, two rules which match the same request but have conflicting actions will result in their actions being compounded. In other words, Traffic Server does not stop on the first match.

    And we can't change the current behavior, or we'd break people.

    I think we all agree the behavior is highly unintuitive. We're planning to rewrite all configs in YAML. When we rewrite cache.config in YAML, we should make that design not additive, or somehow more intuitive.

  4. rob05c commented on Apr 12, 2021

    @rob05c
    Member

    See #7701

    I recommend closing this issue in favor of #7701

  5. bryancall commented on Apr 12, 2021

    @bryancall
    Contributor

    Closing based on @rob05c comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions