trafficserver icon indicating copy to clipboard operation
trafficserver copied to clipboard

ATS 10.0.x, `*_HIT` always on event log. NO `TCP_MISS` with ttl-in-cache on cache.config at all

Open Solarisbf opened this issue 1 year ago • 3 comments

hello !

i would like to ask about cache.config

cache.config is below


dest_domain=test2222.kinxzone.com ttl-in-cache=20s


records.yaml is below


records:
  http:
    connect_attempts_max_retries: 3
    cache:
      http: 1
      required_headers: 0
      max_stale_age: 0
    server_ports: 80 80:ipv6 443:ssl
    normalize_ae: 2
  reverse_proxy:
    enabled: 1
  url_remap:
    pristine_host_hdr: 0
    remap_required: 1
  log:
    logging_enabled: 3
    logfile_dir: var/log/trafficserver
    rolling_enabled: 1
    rolling_interval_sec: 300
    rolling_allow_empty: 1
    rolling_max_count: 10
  ssl:
    client:
      version:
        min: 2
        max: 3
      certification_level: 1
      verify:
        server:
          policy: PERMISSIVE
    server:
      multicert:
        exit_on_load_fail: 0
      cert:
        path: /opt/ts/etc/trafficserver/ssl
      private_key:
        path: /opt/ts/etc/trafficserver/ssl
  diags:
    debug:
      enabled: 1

and i did curl https://test2222.kinxzone.com/cat/cat1.jpg

about 20 seconds later, i did curl https://test2222.kinxzone.com/cat/cat1.jpg again

but always *_HIT Nothing TCP_MISS

even i set revalidate 20s and, pin-in-cache 20s

but same result

i refered https://docs.trafficserver.apache.org/en/10.0.x/admin-guide/files/cache.config.en.html

i know that PURGE method can be used to clear cache exactly

curl -X PURGE https://test2222.kinxzone.com/cat/cat1.jpg

it works well,

and invalidating cache by using regex revalidate plugin as well

event.log is below


1724744803 3 127.0.0.1 200 6345 GET https://test2222.kinxzone.com/cat/cat1.jpg 443 - "curl/7.81.0" - "-" TLSv1.3 TCP_HIT 0 5912 127.0.0.1
1724744804 2 127.0.0.1 200 6345 GET https://test2222.kinxzone.com/cat/cat1.jpg 443 - "curl/7.81.0" - "-" TLSv1.3 TCP_HIT 1 5912 127.0.0.1
1724744804 2 127.0.0.1 200 6345 GET https://test2222.kinxzone.com/cat/cat1.jpg 443 - "curl/7.81.0" - "-" TLSv1.3 TCP_MEM_HIT 2 5912 127.0.0.1
1724744804 2 127.0.0.1 200 6345 GET https://test2222.kinxzone.com/cat/cat1.jpg 443 - "curl/7.81.0" - "-" TLSv1.3 TCP_MEM_HIT 3 5912 127.0.0.1
1724744829 2 127.0.0.1 200 6345 GET https://test2222.kinxzone.com/cat/cat1.jpg 443 - "curl/7.81.0" - "-" TLSv1.3 TCP_MEM_HIT 4 5912 127.0.0.1


i would like to see TCP_MISS on event.log

how to set cache.config for setting ttl exactly ?

Please give me some any informations

@bneradt @calavera @janfrode @biilmann @jpeach @sekimura @mlibbey

thank you !!!

Solarisbf avatar Aug 27 '24 07:08 Solarisbf

maybe cache.config does not work at all

please check cache.config please

https://docs.trafficserver.apache.org/en/10.0.x/admin-guide/files/cache.config.en.html

so, i used header_rewrite plugin to set Cache-Control: max-age=<seconds> on READ_RESPONSE_HDR_HOOK

and i solved it

Solarisbf avatar Aug 28 '24 07:08 Solarisbf

Reopening for further investigation. Thanks for the report!

cmcfarlen avatar Aug 29 '24 15:08 cmcfarlen

This issue has been automatically marked as stale because it has not had recent activity. Marking it stale to flag it for further consideration by the community.

github-actions[bot] avatar Sep 05 '25 02:09 github-actions[bot]