You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by GitBox <gi...@apache.org> on 2021/04/02 17:51:38 UTC

[GitHub] [trafficserver] paladox opened a new issue #7671: Caching doesn't seem to work

paladox opened a new issue #7671:
URL: https://github.com/apache/trafficserver/issues/7671


   We've setup a ats instance that has both port 80 and 443 (one instance). We've configured it to connect to our mediawiki backends that run nginx. We are finding that it's not caching. Or at least sometimes caching intermittently.
   
   Our records.config:
   
   ```
   # https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.config.en.html
   # This file is managed by Puppet.
   
   # traffic_manager TCP ports
   CONFIG proxy.config.http.server_ports STRING 443:ssl 443:ipv6:ssl 80 80:ipv6
   CONFIG proxy.config.admin.user_id STRING trafficserver
   
   CONFIG proxy.config.http.insert_request_via_str INT 3
   CONFIG proxy.config.http.insert_response_via_str INT 3
   CONFIG proxy.config.http.insert_client_ip INT 0
   CONFIG proxy.config.http.insert_squid_x_forwarded_for INT 0
   CONFIG proxy.config.http.response_server_enabled INT 2
   
   CONFIG proxy.config.url_remap.pristine_host_hdr INT 1
   CONFIG proxy.config.disable_configuration_modification INT 1
   
   CONFIG proxy.config.plugin.lua.max_states INT 256
   
   # Network settings
   CONFIG proxy.config.net.connections_throttle INT 0
   CONFIG proxy.config.net.sock_option_flag_in INT 5
   CONFIG proxy.config.net.default_inactivity_timeout INT 360
   CONFIG proxy.config.net.max_connections_in INT 270000
   CONFIG proxy.config.net.max_connections_active_in INT 90000
   # HTTP/2 settings
   CONFIG proxy.config.http2.stream_priority_enabled INT 0
   CONFIG proxy.config.http2.max_settings_per_frame INT 7
   CONFIG proxy.config.http2.max_settings_per_minute INT 14
   CONFIG proxy.config.http2.max_settings_frames_per_minute INT 14
   CONFIG proxy.config.http2.max_ping_frames_per_minute INT 60
   CONFIG proxy.config.http2.max_priority_frames_per_minute INT 0
   CONFIG proxy.config.http2.min_avg_window_update FLOAT 2560.0
   CONFIG proxy.config.http2.accept_no_activity_timeout INT 180
   CONFIG proxy.config.http2.no_activity_timeout_in INT 180
   CONFIG proxy.config.http2.stream_error_rate_threshold FLOAT 1.0
   
   # HTTP settings
   CONFIG proxy.config.http.connect_attempts_timeout INT 9
   CONFIG proxy.config.http.post_connect_attempts_timeout INT 11
   CONFIG proxy.config.http.transaction_no_activity_timeout_in INT 200
   CONFIG proxy.config.http.transaction_no_activity_timeout_out INT 180
   CONFIG proxy.config.http.keep_alive_no_activity_timeout_in INT 120
   CONFIG proxy.config.http.keep_alive_no_activity_timeout_out INT 120
   CONFIG proxy.config.http.accept_no_activity_timeout INT 180
   CONFIG proxy.config.http.send_100_continue_response INT 0
   CONFIG proxy.config.http.max_post_size INT 0
   CONFIG proxy.config.http.allow_half_open INT 1
   # keep-alive configuration for connections against origin servers
   CONFIG proxy.config.http.keep_alive_enabled_out INT 1
   CONFIG proxy.config.http.keep_alive_post_out INT 1
   
   # Origin server connection reuse
   CONFIG proxy.config.http.server_session_sharing.match STRING both
   CONFIG proxy.config.http.server_session_sharing.pool STRING thread
   # Allow origin server connection reuse for requests with Authorization
   CONFIG proxy.config.http.auth_server_session_private INT 0
   
   CONFIG proxy.config.http.cache.cache_responses_to_cookies INT 1
   CONFIG proxy.config.http.cache.guaranteed_max_lifetime INT 86400
   # Do not accept inbound connections until the cache is enabled
   CONFIG proxy.config.http.wait_for_cache INT 2
   
   #proxy.config.http.cache.when_to_revalidate INT 4
   
   # RAM Cache
   CONFIG proxy.config.cache.ram_cache.size INT -1
   CONFIG proxy.config.cache.ram_cache_cutoff INT 8388608 # 8MB
   # 0=no compression, 1=Fastlz, 2=Libz, 3=Liblzma
   CONFIG proxy.config.cache.ram_cache.compress INT 2
   
   # Disk Cache
   # max_doc_size needs to be disabled in order for Read While Writer to function
   # properly. See cache-basics.en.html#read-while-writer. We use Lua to avoid
   # caching documents with explicit Content-Length > 1G, see
   # do_global_read_response().
   CONFIG proxy.config.cache.max_doc_size INT 0
   
   # Parent proxy
   CONFIG proxy.config.http.parent_proxy_routing_enable INT 1
   CONFIG proxy.config.http.parent_proxy.self_detect INT 0
   CONFIG proxy.config.http.parent_proxy.retry_time INT 1
   CONFIG proxy.config.http.no_dns_just_forward_to_parent INT 0
   CONFIG proxy.config.http.parent_proxy.connect_attempts_timeout INT 9
   
   # XDebug Plugin
   CONFIG proxy.config.diags.debug.enabled INT 1
   #CONFIG proxy.config.diags.debug.tags STRING http|dns
   CONFIG proxy.config.diags.debug.tags STRING http|cache
   
   # Request coalescing default values:
   # proxy.config.cache.enable_read_while_writer 1
   # proxy.config.http.cache.max_open_read_retries -1
   # proxy.config.http.cache.max_open_write_retries 1
   # proxy.config.http.cache.open_write_fail_action 0
   CONFIG proxy.config.cache.enable_read_while_writer INT 1
   CONFIG proxy.config.http.cache.max_open_read_retries INT 50
   CONFIG proxy.config.http.cache.max_open_write_retries INT 150
   # In any case, fail open
   CONFIG proxy.config.http.cache.open_write_fail_action INT 0
   
   # logging: send diags to stdout/stderr (systemd journal)
   CONFIG proxy.config.diags.output.status STRING O
   CONFIG proxy.config.diags.output.note STRING O
   CONFIG proxy.config.diags.output.warning STRING O
   CONFIG proxy.config.diags.output.error STRING E
   CONFIG proxy.config.diags.output.fatal STRING E
   CONFIG proxy.config.diags.output.alert STRING E
   CONFIG proxy.config.diags.output.emergency STRING E
   # ATS stops logging if the logging directory has less than
   # max_space_mb_headroom (default: 1000 MB) available
   CONFIG proxy.config.log.max_space_mb_headroom INT 0
   # Do not rotate logfiles
   CONFIG proxy.config.log.rolling_enabled INT 0
   # Flush logs immediately
   CONFIG proxy.config.log.max_secs_per_buffer INT 0
   # React immediatelly to log files being rotated
   CONFIG proxy.config.log.file_stat_frequency INT 1
   # Bumped from the default (9216) to address the following error: "Skipping the
   # current log entry because its size exceeds the maximum payload space in a log
   # buffer"
   CONFIG proxy.config.log.log_buffer_size INT 147456
   CONFIG proxy.config.log.max_line_size INT 147456
   
   # Incoming TLS settings
   CONFIG proxy.config.ssl.server.honor_cipher_order INT 1
   CONFIG proxy.config.ssl.TLSv1 INT 0
   CONFIG proxy.config.ssl.TLSv1_1 INT 0
   CONFIG proxy.config.ssl.TLSv1_2 INT 1
   CONFIG proxy.config.ssl.TLSv1_3 INT 1
   CONFIG proxy.config.ssl.server.cipher_suite STRING -ALL:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256
   CONFIG proxy.config.ssl.server.TLSv1_3.cipher_suites STRING TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256
   CONFIG proxy.config.ssl.server.groups_list STRING X25519:prime256v1
   CONFIG proxy.config.ssl.server.cert.path STRING /etc/ssl/localcerts/
   CONFIG proxy.config.ssl.server.private_key.path STRING /etc/ssl/private/
   CONFIG proxy.config.ssl.max_record_size INT 16383
   CONFIG proxy.config.ssl.ocsp.enabled INT 0
   CONFIG proxy.config.ssl.session_cache INT 2
   CONFIG proxy.config.ssl.session_cache.timeout INT 86400
   CONFIG proxy.config.ssl.session_cache.auto_clear INT 1
   CONFIG proxy.config.ssl.session_cache.size INT 512000
   CONFIG proxy.config.ssl.session_cache.num_buckets INT 32768
   CONFIG proxy.config.ssl.cert.load_elevated INT 1
   CONFIG proxy.config.ssl.server.session_ticket.enable INT 0
   CONFIG proxy.config.ssl.handshake_timeout_in INT 60
   CONFIG proxy.config.ssl.server.prioritize_chacha INT 1
   # Outbound TLS settings
   CONFIG proxy.config.ssl.client.TLSv1 INT 0
   CONFIG proxy.config.ssl.client.TLSv1_1 INT 0
   CONFIG proxy.config.ssl.client.TLSv1_2 INT 1
   CONFIG proxy.config.ssl.client.TLSv1_3 INT 1
   CONFIG proxy.config.ssl.client.cipher_suite STRING -ALL:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384
   CONFIG proxy.config.ssl.client.TLSv1_3.cipher_suites STRING TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256
   # Origin server certificate validation settings
   CONFIG proxy.config.ssl.client.verify.server INT 2
   CONFIG proxy.config.ssl.client.CA.cert.path STRING /etc/ssl/certs
   CONFIG proxy.config.ssl.client.CA.cert.filename STRING ca-certificates.crt
   
   # Location of HTML template for error pages
   CONFIG proxy.config.body_factory.template_sets_dir STRING /etc/trafficserver/error_template
   
   CONFIG proxy.config.http.cache.required_headers INT 1
   ```
   
   Our parent.config
   
   ```
   # https://docs.trafficserver.apache.org/en/latest/admin-guide/files/parent.config.en.html
   # This file is managed by Puppet.
   dest_domain=backends.miraheze.org parent="mw8.miraheze.org:443,mw9.miraheze.org:443,mw10.miraheze.org:443,mw11.miraheze.org:443" parent_is_proxy=false round_robin=strict
   ```
   
   Our remap.config
   
   ```
   ....
   map / https://backends.miraheze.org
   ```
   
   Do we need a ats tls terminator and a ats backend for caching to work or is there something we are doing wrong in the backend?
   
   Here's the response for one site from the backend:
   
   ```
   HTTP/2 200 
   server: nginx
   date: Fri, 02 Apr 2021 17:50:13 GMT
   content-type: text/html; charset=UTF-8
   x-powered-by: PHP/7.3.27-1~deb10u1
   x-content-type-options: nosniff
   p3p: CP="This is not a P3P policy! See https://allthetropes.org/wiki/Special:CentralAutoLogin/P3P for more info."
   content-language: en
   vary: Accept-Encoding, Cookie, Authorization
   cache-control: s-maxage=18000, must-revalidate, max-age=0
   last-modified: Fri, 02 Apr 2021 12:50:13 GMT
   x-request-id: bf43dd40382ddb8920728ec8
   strict-transport-security: max-age=604800
   x-served-by: mw8.miraheze.org
   x-xss-protection: 1; mode=block
   x-frame-options: ALLOW-FROM static.miraheze.org
   age: 0
   via: https/1.1 localhost (ApacheTrafficServer/8.0.2 [uScMsSf pSeN:t cCMpSs ])
   ```
   
   we added some debug so `via` shows.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] paladox commented on issue #7671: Caching doesn't seem to work

Posted by GitBox <gi...@apache.org>.
paladox commented on issue #7671:
URL: https://github.com/apache/trafficserver/issues/7671#issuecomment-826151483


   Found the reason! Sorry for wasting your time.
   
   We had wgUseCdn off on the test server as it isn't supposed to go through the cache proxies (ats/varnish).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] paladox commented on issue #7671: Caching doesn't seem to work

Posted by GitBox <gi...@apache.org>.
paladox commented on issue #7671:
URL: https://github.com/apache/trafficserver/issues/7671#issuecomment-815965817


   Weird thing is it take a little while for the below to work before it says "uScRs f p eN:t cCHp s " (as in I have to keep trying until it says cached). But it wont work on any other url.
   
   ```
   curl --resolve meta.miraheze.org:443:127.0.0.1 https://meta.miraheze.org/wiki/Main_Page  -I
   HTTP/2 200 
   server: nginx
   date: Thu, 08 Apr 2021 16:25:41 GMT
   content-type: text/html; charset=UTF-8
   x-powered-by: PHP/7.3.27-1~deb10u1
   x-content-type-options: nosniff
   p3p: CP="This is not a P3P policy! See https://meta.miraheze.org/wiki/Special:CentralAutoLogin/P3P for more info."
   content-language: en
   vary: Accept-Encoding, Cookie, Authorization
   cache-control: s-maxage=18000, must-revalidate, max-age=0
   last-modified: Thu, 08 Apr 2021 15:56:14 GMT
   x-request-id: 08ba58dfdb9278fcf971980f
   strict-transport-security: max-age=31536000; includeSubDomains; preload
   x-served-by: mw10.miraheze.org
   x-xss-protection: 1; mode=block
   x-frame-options: ALLOW-FROM static.miraheze.org
   age: 40
   content-length: 37006
   via: http/1.1 localhost (ApacheTrafficServer/8.0.2 [uScRs f p eN:t cCHp s ])
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] paladox commented on issue #7671: Caching doesn't seem to work

Posted by GitBox <gi...@apache.org>.
paladox commented on issue #7671:
URL: https://github.com/apache/trafficserver/issues/7671#issuecomment-826150408


   I see this for varnish (and it hits the cache):
   
   cache-control: private, s-maxage=0, max-age=0, must-revalidate
   
   ```
   HTTP/2 200 
   server: nginx
   date: Sat, 24 Apr 2021 20:38:14 GMT
   content-type: text/html; charset=UTF-8
   x-powered-by: PHP/7.3.27-1~deb10u1
   x-content-type-options: nosniff
   p3p: CP="This is not a P3P policy! See https://meta.miraheze.org/wiki/Special:CentralAutoLogin/P3P for more info."
   content-language: en
   vary: Accept-Encoding, Cookie, Authorization
   last-modified: Sat, 24 Apr 2021 15:38:08 GMT
   x-request-id: b1d978729e313bac627cc4b0
   strict-transport-security: max-age=31536000; includeSubDomains; preload
   x-served-by: mw11.miraheze.org
   x-varnish: 63885517 72010887
   age: 5
   via: 1.1 varnish (Varnish/6.1)
   cache-control: private, s-maxage=0, max-age=0, must-revalidate
   x-cache: cp10 HIT (2)
   permissions-policy: interest-cohort=()
   content-security-policy: default-src 'self' blob: data:  *.miraheze.org *.wikimedia.org *.wikipedia.org *.wikibooks.org *.wiktionary.org *.wikiquote.org *.wikisource.org *.wikiversity.org *.wikinews.org *.wikivoyage.org *.mediawiki.org mediawiki.org *.wikidata.org wikidata.org *.wmflabs.org *.google.com *.gstatic.com *.addthis.com *.youtube.com *.youtube-nocookie.com maxcdn.bootstrapcdn.com twitter.com *.creativecommons.org images.uncyc.org www.mikrodev.com *.reviservices.com *.twitter.com www.sciencedaily.com *.googleapis.com *.twimg.com discordapp.com *.openstreetmap.org *.freenode.net *.sorcery.net *.fontawesome.com *.a.wmflabs.org nenawiki.org *.cloudytheology.com i.imgur.com na.llnet.sims3store.cdn.ea.com cdn.discordapp.com m.media-amazon.com image.tmdb.org *.stripe.com *.twitch.tv *.fastly.net *.facebook.com *.shields.io *.bilibili.com *.163.com discord.com googleusercontent.com imgbox.com cdnjs.cloudflare.com cdn.jsdelivr.net reddit.com *.reddit.com redd.it *.redd.it reddit
 media.com *.redditmedia.com dropbox.com *.dropbox.com dropboxstatic.com *.dropboxstatic.com disqus.com *.disqus.com *.nicovideo.jp lh3.googleusercontent.com db.onlinewebfonts.com wikiapiary.com *.vimeo.com *.googleusercontent.com *.imgbox.com www.gnu.org www.desmos.com z.moatads.com www.recaptcha.net snap.berkeley.edu *.netease.com openlayers.org wikiplus-app.com minotar.net *.tile.openstreetmap.org live.staticflickr.com *.pixabay.com cdn.geogebra.org docs.blender.org 'unsafe-inline' 'unsafe-eval'; frame-ancestors 'self'  *.miraheze.org
   accept-ranges: bytes
   x-served-by: cp10.miraheze.org
   x-xss-protection: 1; mode=block
   x-frame-options: ALLOW-FROM static.miraheze.org
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] paladox commented on issue #7671: Caching doesn't seem to work

Posted by GitBox <gi...@apache.org>.
paladox commented on issue #7671:
URL: https://github.com/apache/trafficserver/issues/7671#issuecomment-815967111


   Looking at varnish this is what happens:
   
   Before its cached:
   
   ```
   curl https://meta.miraheze.org/wiki/Main_Page  -I
   HTTP/2 200 
   server: nginx
   date: Thu, 08 Apr 2021 16:28:24 GMT
   content-type: text/html; charset=UTF-8
   x-powered-by: PHP/7.3.27-1~deb10u1
   x-content-type-options: nosniff
   p3p: CP="This is not a P3P policy! See https://meta.miraheze.org/wiki/Special:CentralAutoLogin/P3P for more info."
   content-language: en
   vary: Accept-Encoding, Cookie, Authorization
   last-modified: Thu, 08 Apr 2021 15:56:14 GMT
   x-request-id: d6a1c73ab80cb72266a0dee6
   strict-transport-security: max-age=31536000; includeSubDomains; preload
   x-served-by: mw11.miraheze.org
   x-varnish: 43648151
   age: 0
   via: 1.1 varnish (Varnish/6.1)
   cache-control: private, s-maxage=0, max-age=0, must-revalidate
   x-cache: cp10 MISS (0)
   content-security-policy: default-src 'self' blob: data:  *.miraheze.org *.wikimedia.org *.wikipedia.org *.wikibooks.org *.wiktionary.org *.wikiquote.org *.wikisource.org *.wikiversity.org *.wikinews.org *.wikivoyage.org *.mediawiki.org mediawiki.org *.wikidata.org wikidata.org *.wmflabs.org *.google.com *.gstatic.com *.addthis.com *.youtube.com *.youtube-nocookie.com maxcdn.bootstrapcdn.com twitter.com *.creativecommons.org images.uncyc.org www.mikrodev.com *.reviservices.com *.twitter.com www.sciencedaily.com *.googleapis.com *.twimg.com discordapp.com *.openstreetmap.org *.freenode.net *.sorcery.net *.fontawesome.com *.a.wmflabs.org nenawiki.org *.cloudytheology.com i.imgur.com na.llnet.sims3store.cdn.ea.com cdn.discordapp.com m.media-amazon.com image.tmdb.org *.stripe.com *.twitch.tv *.fastly.net *.facebook.com *.shields.io *.bilibili.com *.163.com discord.com googleusercontent.com imgbox.com cdnjs.cloudflare.com cdn.jsdelivr.net reddit.com *.reddit.com redd.it *.redd.it reddit
 media.com *.redditmedia.com dropbox.com *.dropbox.com dropboxstatic.com *.dropboxstatic.com disqus.com *.disqus.com *.nicovideo.jp lh3.googleusercontent.com db.onlinewebfonts.com wikiapiary.com *.vimeo.com *.googleusercontent.com *.imgbox.com www.gnu.org www.desmos.com z.moatads.com www.recaptcha.net snap.berkeley.edu *.netease.com openlayers.org wikiplus-app.com minotar.net *.tile.openstreetmap.org live.staticflickr.com *.pixabay.com cdn.geogebra.org docs.blender.org 'unsafe-inline' 'unsafe-eval'; frame-ancestors 'self'  *.miraheze.org
   accept-ranges: bytes
   x-served-by: cp10.miraheze.org
   x-xss-protection: 1; mode=block
   x-frame-options: ALLOW-FROM static.miraheze.org
   ```
   
   
   After its cached:
   
   ```
   curl https://meta.miraheze.org/wiki/Main_Page  -I
   HTTP/2 200 
   server: nginx
   date: Thu, 08 Apr 2021 16:28:29 GMT
   content-type: text/html; charset=UTF-8
   x-powered-by: PHP/7.3.27-1~deb10u1
   x-content-type-options: nosniff
   p3p: CP="This is not a P3P policy! See https://meta.miraheze.org/wiki/Special:CentralAutoLogin/P3P for more info."
   content-language: en
   vary: Accept-Encoding, Cookie, Authorization
   last-modified: Thu, 08 Apr 2021 15:56:14 GMT
   x-request-id: d6a1c73ab80cb72266a0dee6
   strict-transport-security: max-age=31536000; includeSubDomains; preload
   x-served-by: mw11.miraheze.org
   x-varnish: 34522198 43648152
   age: 4
   via: 1.1 varnish (Varnish/6.1)
   cache-control: private, s-maxage=0, max-age=0, must-revalidate
   x-cache: cp10 HIT (3)
   content-security-policy: default-src 'self' blob: data:  *.miraheze.org *.wikimedia.org *.wikipedia.org *.wikibooks.org *.wiktionary.org *.wikiquote.org *.wikisource.org *.wikiversity.org *.wikinews.org *.wikivoyage.org *.mediawiki.org mediawiki.org *.wikidata.org wikidata.org *.wmflabs.org *.google.com *.gstatic.com *.addthis.com *.youtube.com *.youtube-nocookie.com maxcdn.bootstrapcdn.com twitter.com *.creativecommons.org images.uncyc.org www.mikrodev.com *.reviservices.com *.twitter.com www.sciencedaily.com *.googleapis.com *.twimg.com discordapp.com *.openstreetmap.org *.freenode.net *.sorcery.net *.fontawesome.com *.a.wmflabs.org nenawiki.org *.cloudytheology.com i.imgur.com na.llnet.sims3store.cdn.ea.com cdn.discordapp.com m.media-amazon.com image.tmdb.org *.stripe.com *.twitch.tv *.fastly.net *.facebook.com *.shields.io *.bilibili.com *.163.com discord.com googleusercontent.com imgbox.com cdnjs.cloudflare.com cdn.jsdelivr.net reddit.com *.reddit.com redd.it *.redd.it reddit
 media.com *.redditmedia.com dropbox.com *.dropbox.com dropboxstatic.com *.dropboxstatic.com disqus.com *.disqus.com *.nicovideo.jp lh3.googleusercontent.com db.onlinewebfonts.com wikiapiary.com *.vimeo.com *.googleusercontent.com *.imgbox.com www.gnu.org www.desmos.com z.moatads.com www.recaptcha.net snap.berkeley.edu *.netease.com openlayers.org wikiplus-app.com minotar.net *.tile.openstreetmap.org live.staticflickr.com *.pixabay.com cdn.geogebra.org docs.blender.org 'unsafe-inline' 'unsafe-eval'; frame-ancestors 'self'  *.miraheze.org
   accept-ranges: bytes
   x-served-by: cp10.miraheze.org
   x-xss-protection: 1; mode=block
   x-frame-options: ALLOW-FROM static.miraheze.org
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] paladox commented on issue #7671: Caching doesn't seem to work

Posted by GitBox <gi...@apache.org>.
paladox commented on issue #7671:
URL: https://github.com/apache/trafficserver/issues/7671#issuecomment-826150508


   Ah ack @ expires


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] mlibbey commented on issue #7671: Caching doesn't seem to work

Posted by GitBox <gi...@apache.org>.
mlibbey commented on issue #7671:
URL: https://github.com/apache/trafficserver/issues/7671#issuecomment-826145469


   `cache-control: private, must-revalidate, max-age=0`
   - `private` means that caches that are solely dedicated to individuals (like your browser) can cache. This is the biggie -- need to change this to public
   - `must-revalidate, max-age=0` ... these mean that the cache could store them, but, need to talk to origin server each and every time to make sure the object can be released. I believe that `no-cache` is the more direct way of indicating this combination. Either way, its a terrible combination for Traffic Server, as it will make any read-while-write (eg request collapsing) requests go in serial.
   - There is also an `expires: Sat, 24 Apr 2021 15:34:15 GMT` -- which matches the date, which is also saying the object immediately is stale.
   - The origin server also says to vary on encoding (makes sense -- compressed v non-compressed), cookie and Authorization (which will very likely be unique to each user ... perhaps why they put in private). There are settings for the number of variants, but, with a variant per user, it seems like it'd be difficult to choose a reasonably number. 
   
   Ideally, the origin server folks would rethink their choices above. Alternatively, you can use the header_rewrite plugin to override their decisions -- remove/replace the headers as you deem necessary.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] paladox commented on issue #7671: Caching doesn't seem to work

Posted by GitBox <gi...@apache.org>.
paladox commented on issue #7671:
URL: https://github.com/apache/trafficserver/issues/7671#issuecomment-816356942


   Seems to work:
   
   ```
   root@test4:/home/paladox# curl -o/dev/null -D- --resolve meta.miraheze.org:443:127.0.0.1 https://meta.miraheze.org/wiki/Miraheze
     % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                    Dload  Upload   Total   Spent    Left  Speed
     0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0HTTP/2 200 
   server: nginx
   date: Fri, 09 Apr 2021 02:27:43 GMT
   content-type: text/html; charset=UTF-8
   x-powered-by: PHP/7.3.27-1~deb10u1
   x-content-type-options: nosniff
   p3p: CP="This is not a P3P policy! See https://meta.miraheze.org/wiki/Special:CentralAutoLogin/P3P for more info."
   content-language: en
   vary: Accept-Encoding, Cookie, Authorization
   cache-control: s-maxage=18000, must-revalidate, max-age=0
   last-modified: Fri, 09 Apr 2021 02:19:20 GMT
   x-request-id: cf32467241ad080afca77fcc
   strict-transport-security: max-age=31536000; includeSubDomains; preload
   x-served-by: mw9.miraheze.org
   x-xss-protection: 1; mode=block
   x-frame-options: ALLOW-FROM static.miraheze.org
   age: 3
   content-length: 36658
   via: http/1.1 localhost (ApacheTrafficServer/8.0.2 [uScRs f p eN:t cCHp s ])
   
   100 36658  100 36658    0     0  5966k      0 --:--:-- --:--:-- --:--:-- 5966k
   ```
   
   ```
   root@test4:/home/paladox# curl -o/dev/null -D- --resolve meta.miraheze.org:443:127.0.0.1 https://meta.miraheze.org/wiki/Help_center
     % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                    Dload  Upload   Total   Spent    Left  Speed
     0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0HTTP/2 200 
   server: nginx
   date: Fri, 09 Apr 2021 02:29:49 GMT
   content-type: text/html; charset=UTF-8
   x-powered-by: PHP/7.3.27-1~deb10u1
   x-content-type-options: nosniff
   p3p: CP="This is not a P3P policy! See https://meta.miraheze.org/wiki/Special:CentralAutoLogin/P3P for more info."
   content-language: en
   vary: Accept-Encoding, Cookie, Authorization
   cache-control: s-maxage=18000, must-revalidate, max-age=0
   last-modified: Thu, 08 Apr 2021 22:10:50 GMT
   x-request-id: 7290d5d35c62b9c61eb963cb
   strict-transport-security: max-age=31536000; includeSubDomains; preload
   x-served-by: mw9.miraheze.org
   x-xss-protection: 1; mode=block
   x-frame-options: ALLOW-FROM static.miraheze.org
   age: 0
   via: https/1.1 localhost (ApacheTrafficServer/8.0.2 [uScMsSfWpSeN:t cCMpSs ])
   
   100 35699    0 35699    0     0  64555      0 --:--:-- --:--:-- --:--:-- 64555
   root@test4:/home/paladox# curl -o/dev/null -D- --resolve meta.miraheze.org:443:127.0.0.1 https://meta.miraheze.org/wiki/Help_center
     % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                    Dload  Upload   Total   Spent    Left  Speed
     0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0HTTP/2 200 
   server: nginx
   date: Fri, 09 Apr 2021 02:29:49 GMT
   content-type: text/html; charset=UTF-8
   x-powered-by: PHP/7.3.27-1~deb10u1
   x-content-type-options: nosniff
   p3p: CP="This is not a P3P policy! See https://meta.miraheze.org/wiki/Special:CentralAutoLogin/P3P for more info."
   content-language: en
   vary: Accept-Encoding, Cookie, Authorization
   cache-control: s-maxage=18000, must-revalidate, max-age=0
   last-modified: Thu, 08 Apr 2021 22:10:50 GMT
   x-request-id: 7290d5d35c62b9c61eb963cb
   strict-transport-security: max-age=31536000; includeSubDomains; preload
   x-served-by: mw9.miraheze.org
   x-xss-protection: 1; mode=block
   x-frame-options: ALLOW-FROM static.miraheze.org
   age: 2
   content-length: 35699
   via: http/1.1 localhost (ApacheTrafficServer/8.0.2 [uScHs f p eN:t cCHp s ])
   
   100 35699  100 35699    0     0  3873k      0 --:--:-- --:--:-- --:--:-- 3873k
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] paladox commented on issue #7671: Caching doesn't seem to work

Posted by GitBox <gi...@apache.org>.
paladox commented on issue #7671:
URL: https://github.com/apache/trafficserver/issues/7671#issuecomment-826110833






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] bryancall closed issue #7671: Caching doesn't seem to work

Posted by GitBox <gi...@apache.org>.
bryancall closed issue #7671:
URL: https://github.com/apache/trafficserver/issues/7671


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] paladox commented on issue #7671: Caching doesn't seem to work

Posted by GitBox <gi...@apache.org>.
paladox commented on issue #7671:
URL: https://github.com/apache/trafficserver/issues/7671#issuecomment-826150802


   I can see why it does it now...
   
   ```cache-control: s-maxage=18000, must-revalidate, max-age=0```
   
   on one of our mw* servers compared to our test mw* server
   
   ```cache-control: private, must-revalidate, max-age=0```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] mlibbey commented on issue #7671: Caching doesn't seem to work

Posted by GitBox <gi...@apache.org>.
mlibbey commented on issue #7671:
URL: https://github.com/apache/trafficserver/issues/7671#issuecomment-826145469


   `cache-control: private, must-revalidate, max-age=0`
   - `private` means that caches that are solely dedicated to individuals (like your browser) can cache. This is the biggie -- need to change this to public
   - `must-revalidate, max-age=0` ... these mean that the cache could store them, but, need to talk to origin server each and every time to make sure the object can be released. I believe that `no-cache` is the more direct way of indicating this combination. Either way, its a terrible combination for Traffic Server, as it will make any read-while-write (eg request collapsing) requests go in serial.
   - There is also an `expires: Sat, 24 Apr 2021 15:34:15 GMT` -- which matches the date, which is also saying the object immediately is stale.
   - The origin server also says to vary on encoding (makes sense -- compressed v non-compressed), cookie and Authorization (which will very likely be unique to each user ... perhaps why they put in private). There are settings for the number of variants, but, with a variant per user, it seems like it'd be difficult to choose a reasonably number. 
   
   Ideally, the origin server folks would rethink their choices above. Alternatively, you can use the header_rewrite plugin to override their decisions -- remove/replace the headers as you deem necessary.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] mlibbey commented on issue #7671: Caching doesn't seem to work

Posted by GitBox <gi...@apache.org>.
mlibbey commented on issue #7671:
URL: https://github.com/apache/trafficserver/issues/7671#issuecomment-816349847


   I have a theory. You show you are using curl -I... I bet you are seeing it cache after you don't have the -I. (curl -I issues a HEAD request. HEAD requests don't fill the cache -- a GET request is needed to fill. Can you try `curl -o/dev/null -D-  --resolve meta.miraheze.org:443:127.0.0.1 https://meta.miraheze.org/wiki/Main_Page` ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] paladox commented on issue #7671: Caching doesn't seem to work

Posted by GitBox <gi...@apache.org>.
paladox commented on issue #7671:
URL: https://github.com/apache/trafficserver/issues/7671#issuecomment-826110833


   Seems to not work again even though I'm using GET requests.
   
   ```
   root@test4:/home/paladox# curl -o/dev/null -D- --resolve meta.miraheze.org:443:127.0.0.1 https://meta.miraheze.org/wiki/Main_Page
     % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                    Dload  Upload   Total   Spent    Left  Speed
     0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0HTTP/2 200 
   server: nginx
   date: Sat, 24 Apr 2021 15:34:15 GMT
   content-type: text/html; charset=UTF-8
   x-content-type-options: nosniff
   p3p: CP="This is not a P3P policy! See https://meta.miraheze.org/wiki/Special:CentralAutoLogin/P3P for more info."
   content-language: en
   vary: Accept-Encoding, Cookie, Authorization
   expires: Sat, 24 Apr 2021 15:34:15 GMT
   cache-control: private, must-revalidate, max-age=0
   last-modified: Sat, 24 Apr 2021 13:44:46 GMT
   x-request-id: dd7354461718073839f2fc57
   strict-transport-security: max-age=31536000; includeSubDomains; preload
   x-served-by: test3.miraheze.org
   x-xss-protection: 1; mode=block
   x-frame-options: ALLOW-FROM static.miraheze.org
   age: 1
   x-cache-int: test4 miss
   content-security-policy: default-src 'self' blob: data:  *.miraheze.org *.wikimedia.org *.wikipedia.org *.wikibooks.org *.wiktionary.org *.wikiquote.org *.wikisource.org *.wikiversity.org *.wikinews.org *.wikivoyage.org *.mediawiki.org mediawiki.org *.wikidata.org wikidata.org *.wmflabs.org *.google.com *.gstatic.com *.addthis.com *.youtube.com *.youtube-nocookie.com maxcdn.bootstrapcdn.com twitter.com *.creativecommons.org images.uncyc.org www.mikrodev.com *.reviservices.com *.twitter.com www.sciencedaily.com *.googleapis.com *.twimg.com discordapp.com *.openstreetmap.org *.freenode.net *.sorcery.net *.fontawesome.com *.a.wmflabs.org nenawiki.org *.cloudytheology.com i.imgur.com na.llnet.sims3store.cdn.ea.com cdn.discordapp.com m.media-amazon.com image.tmdb.org *.stripe.com *.twitch.tv *.fastly.net *.facebook.com *.shields.io *.bilibili.com *.163.com discord.com googleusercontent.com imgbox.com cdnjs.cloudflare.com cdn.jsdelivr.net reddit.com *.reddit.com redd.it *.redd.it reddit
 media.com *.redditmedia.com dropbox.com *.dropbox.com dropboxstatic.com *.dropboxstatic.com disqus.com *.disqus.com *.nicovideo.jp lh3.googleusercontent.com db.onlinewebfonts.com wikiapiary.com *.vimeo.com *.googleusercontent.com *.imgbox.com www.gnu.org www.desmos.com z.moatads.com www.recaptcha.net snap.berkeley.edu *.netease.com openlayers.org wikiplus-app.com minotar.net *.tile.openstreetmap.org live.staticflickr.com *.pixabay.com cdn.geogebra.org docs.blender.org 'unsafe-inline' 'unsafe-eval'; frame-ancestors 'self'  *.miraheze.org
   
   100 37184    0 37184    0     0   119k      0 --:--:-- --:--:-- --:--:--  119k
   ```
   
   I've run the above many times and it still says cache miss (even ran it without -I and same thing).
   (Also ran it with -X GET).
   
   Even tried disabling the lua plugins to see if they were the cause.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] paladox commented on issue #7671: Caching doesn't seem to work

Posted by GitBox <gi...@apache.org>.
paladox commented on issue #7671:
URL: https://github.com/apache/trafficserver/issues/7671#issuecomment-816357635


   More...
   
   
   ```
   root@test4:/home/paladox# curl --resolve meta.miraheze.org:443:127.0.0.1 https://meta.miraheze.org/wiki/FAQ -I
   HTTP/2 200 
   server: nginx
   date: Fri, 09 Apr 2021 02:31:30 GMT
   content-type: text/html; charset=UTF-8
   x-powered-by: PHP/7.3.27-1~deb10u1
   x-content-type-options: nosniff
   p3p: CP="This is not a P3P policy! See https://meta.miraheze.org/wiki/Special:CentralAutoLogin/P3P for more info."
   content-language: en
   vary: Accept-Encoding, Cookie, Authorization
   cache-control: s-maxage=18000, must-revalidate, max-age=0
   last-modified: Thu, 08 Apr 2021 22:26:11 GMT
   x-request-id: 36fcd998949a0f5648932f21
   strict-transport-security: max-age=31536000; includeSubDomains; preload
   x-served-by: mw10.miraheze.org
   x-xss-protection: 1; mode=block
   x-frame-options: ALLOW-FROM static.miraheze.org
   age: 0
   via: https/1.1 localhost (ApacheTrafficServer/8.0.2 [uScMsSf pSeN:t cCMpSs ])
   
   root@test4:/home/paladox# curl --resolve meta.miraheze.org:443:127.0.0.1 https://meta.miraheze.org/wiki/FAQ -I
   HTTP/2 200 
   server: nginx
   date: Fri, 09 Apr 2021 02:31:32 GMT
   content-type: text/html; charset=UTF-8
   x-powered-by: PHP/7.3.27-1~deb10u1
   x-content-type-options: nosniff
   p3p: CP="This is not a P3P policy! See https://meta.miraheze.org/wiki/Special:CentralAutoLogin/P3P for more info."
   content-language: en
   vary: Accept-Encoding, Cookie, Authorization
   cache-control: s-maxage=18000, must-revalidate, max-age=0
   last-modified: Thu, 08 Apr 2021 22:54:04 GMT
   x-request-id: 0bdc07a8099750a024d07dd1
   strict-transport-security: max-age=31536000; includeSubDomains; preload
   x-served-by: mw11.miraheze.org
   x-xss-protection: 1; mode=block
   x-frame-options: ALLOW-FROM static.miraheze.org
   age: 1
   via: https/1.1 localhost (ApacheTrafficServer/8.0.2 [uScMsSf pSeN:t cCMpSs ])
   
   root@test4:/home/paladox# curl --resolve meta.miraheze.org:443:127.0.0.1 https://meta.miraheze.org/wiki/FAQ -I -X GET
   HTTP/2 200 
   server: nginx
   date: Fri, 09 Apr 2021 02:31:34 GMT
   content-type: text/html; charset=UTF-8
   x-powered-by: PHP/7.3.27-1~deb10u1
   x-content-type-options: nosniff
   p3p: CP="This is not a P3P policy! See https://meta.miraheze.org/wiki/Special:CentralAutoLogin/P3P for more info."
   content-language: en
   vary: Accept-Encoding, Cookie, Authorization
   cache-control: s-maxage=18000, must-revalidate, max-age=0
   last-modified: Thu, 08 Apr 2021 21:45:41 GMT
   x-request-id: 63ad7501061487a94fd6ce47
   strict-transport-security: max-age=31536000; includeSubDomains; preload
   x-served-by: mw8.miraheze.org
   x-xss-protection: 1; mode=block
   x-frame-options: ALLOW-FROM static.miraheze.org
   age: 0
   via: https/1.1 localhost (ApacheTrafficServer/8.0.2 [uScMsSfWpSeN:t cCMpSs ])
   
   root@test4:/home/paladox# curl --resolve meta.miraheze.org:443:127.0.0.1 https://meta.miraheze.org/wiki/FAQ -I -X GET
   HTTP/2 200 
   server: nginx
   date: Fri, 09 Apr 2021 02:31:34 GMT
   content-type: text/html; charset=UTF-8
   x-powered-by: PHP/7.3.27-1~deb10u1
   x-content-type-options: nosniff
   p3p: CP="This is not a P3P policy! See https://meta.miraheze.org/wiki/Special:CentralAutoLogin/P3P for more info."
   content-language: en
   vary: Accept-Encoding, Cookie, Authorization
   cache-control: s-maxage=18000, must-revalidate, max-age=0
   last-modified: Thu, 08 Apr 2021 21:45:41 GMT
   x-request-id: 63ad7501061487a94fd6ce47
   strict-transport-security: max-age=31536000; includeSubDomains; preload
   x-served-by: mw8.miraheze.org
   x-xss-protection: 1; mode=block
   x-frame-options: ALLOW-FROM static.miraheze.org
   age: 1
   content-length: 74639
   via: http/1.1 localhost (ApacheTrafficServer/8.0.2 [uScHs f p eN:t cCHp s ])
   ```
   
   can we add support for HEAD to trigger cache saves?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] paladox commented on issue #7671: Caching doesn't seem to work

Posted by GitBox <gi...@apache.org>.
paladox commented on issue #7671:
URL: https://github.com/apache/trafficserver/issues/7671#issuecomment-816299832


   Could it be that it doesn't work in ats 8.0? (We run debian 10 with apache ts 8.0).
   
   But even then it doesn't explain why Main_Page gets cached even though it specified the s-maxage and max-age.
   
   I could only get it to work on Main_Page (and that's only after a while of loading it).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] rob05c commented on issue #7671: Caching doesn't seem to work

Posted by GitBox <gi...@apache.org>.
rob05c commented on issue #7671:
URL: https://github.com/apache/trafficserver/issues/7671#issuecomment-815937798


   Yeah, s-maxage should take priority on a shared cache. I'll try to look into adding a test, and if it fails, try to figure out why


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] shinrich commented on issue #7671: Caching doesn't seem to work

Posted by GitBox <gi...@apache.org>.
shinrich commented on issue #7671:
URL: https://github.com/apache/trafficserver/issues/7671#issuecomment-815924639


   It is possible that ATS is not distinguishing between "s-maxage=18000" and "max-age=0" correctly.  We should create an autest for that case.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] bryancall commented on issue #7671: Caching doesn't seem to work

Posted by GitBox <gi...@apache.org>.
bryancall commented on issue #7671:
URL: https://github.com/apache/trafficserver/issues/7671#issuecomment-827168057


   Thank you!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] mlibbey commented on issue #7671: Caching doesn't seem to work

Posted by GitBox <gi...@apache.org>.
mlibbey commented on issue #7671:
URL: https://github.com/apache/trafficserver/issues/7671#issuecomment-816833790


   I'd alternatively recommend:
   - adding this to your .bashrc 
   alias curlhead="curl -sIXGET"
   (curlhead --resolve ... then shows you headers, and doesn't transfer the body to you)
   the background_fill feature is meant to continue the request. Its somewhat broken right now. So...
   - and 
   alias curlr="curl -D- -r 0-0"
   (0 byte range request -- shows you headers, but, the body is 0 bytes.)
   in addition to installing the background_fetch plugin. Your range request will trigger the background fetch plugin to fire, downloading the full object into cache.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] mlibbey commented on issue #7671: Caching doesn't seem to work

Posted by GitBox <gi...@apache.org>.
mlibbey commented on issue #7671:
URL: https://github.com/apache/trafficserver/issues/7671#issuecomment-816297026


   FWIW, s-maxage is working for me on 8.1
   ====First Fetch===
   
   ```
   [16:12:02 httpbin]$ curl -sIXGET --resolve httpbin.local:80:127.0.0.1 "http://httpbin.local/response-headers?cache-control=s-maxage=18000,must-revalidate,max-age=0"
   
   HTTP/1.1 200 OK
   Server: ATS/8.1.2
   Date: Thu, 08 Apr 2021 23:13:15 GMT
   Content-Type: application/json
   Content-Length: 133
   cache-control: s-maxage=18000,must-revalidate,max-age=0
   Access-Control-Allow-Origin: *
   Access-Control-Allow-Credentials: true
   X-B3-TraceId: b718216e7de28332
   Strict-Transport-Security: max-age=31536000
   Age: 0
   Connection: keep-alive
   Via: https/1.1 milesserver (ApacheTrafficServer/8.1.2 [uScMsSfWpSeN:t cCMp sS])
   X-Cache-Key: https://httpbin.org/response-headers?cache-control=s-maxage=18000,must-revalidate,max-age=0
   X-Cache: miss
   X-Remap: from=http://httpbin.local/, to=https://httpbin.org/
   ```
   
   
   
    ==== Should be served cached ... and is ====
   
   ```
   [16:13:15 httpbin]$ curl -sIXGET --resolve httpbin.local:80:127.0.0.1 "http://httpbin.local/response-headers?cache-control=s-maxage=18000,must-revalidate,max-age=0"
   
   HTTP/1.1 200 OK
   Server: ATS/8.1.2
   Date: Thu, 08 Apr 2021 23:13:15 GMT
   Content-Type: application/json
   Content-Length: 133
   cache-control: s-maxage=18000,must-revalidate,max-age=0
   Access-Control-Allow-Origin: *
   Access-Control-Allow-Credentials: true
   X-B3-TraceId: b718216e7de28332
   Strict-Transport-Security: max-age=31536000
   Age: 13
   Connection: keep-alive
   Via: http/1.1 milesserver (ApacheTrafficServer/8.1.2 [uScHs f p eN:t cCHp s ])
   X-Cache-Key: https://httpbin.org/response-headers?cache-control=s-maxage=18000,must-revalidate,max-age=0
   X-Cache: hit-fresh
   X-Remap: from=http://httpbin.local/, to=https://httpbin.org/
   ```
   
   
   
   
    ==== New url and s-max-age ====
   
   ```
   [16:13:28 httpbin]$ curl -sIXGET --resolve httpbin.local:80:127.0.0.1 "http://httpbin.local/response-headers?cache-control=s-maxage=10,must-revalidate,max-age=0"
   
   HTTP/1.1 200 OK
   Server: ATS/8.1.2
   Date: Thu, 08 Apr 2021 23:13:59 GMT
   Content-Type: application/json
   Content-Length: 130
   cache-control: s-maxage=10,must-revalidate,max-age=0
   Access-Control-Allow-Origin: *
   Access-Control-Allow-Credentials: true
   X-B3-TraceId: dc48a4e767d55e01
   Strict-Transport-Security: max-age=31536000
   Age: 0
   Connection: keep-alive
   Via: https/1.1 milesserver (ApacheTrafficServer/8.1.2 [uScMsSfWpSeN:t cCMp sS])
   X-Cache-Key: https://httpbin.org/response-headers?cache-control=s-maxage=10,must-revalidate,max-age=0
   X-Cache: miss
   X-Remap: from=http://httpbin.local/, to=https://httpbin.org/
   
   ```
   
    ==== Should be served cached ... and is ====
   ```
   [16:13:59 httpbin]$ curl -sIXGET --resolve httpbin.local:80:127.0.0.1 "http://httpbin.local/response-headers?cache-control=s-maxage=10,must-revalidate,max-age=0"
   
   HTTP/1.1 200 OK
   Server: ATS/8.1.2
   Date: Thu, 08 Apr 2021 23:13:59 GMT
   Content-Type: application/json
   Content-Length: 130
   cache-control: s-maxage=10,must-revalidate,max-age=0
   Access-Control-Allow-Origin: *
   Access-Control-Allow-Credentials: true
   X-B3-TraceId: dc48a4e767d55e01
   Strict-Transport-Security: max-age=31536000
   Age: 8
   Connection: keep-alive
   Via: http/1.1 milesserver (ApacheTrafficServer/8.1.2 [uScHs f p eN:t cCHp s ])
   X-Cache-Key: https://httpbin.org/response-headers?cache-control=s-maxage=10,must-revalidate,max-age=0
   X-Cache: hit-fresh
   X-Remap: from=http://httpbin.local/, to=https://httpbin.org/
   
   ```
   
    ==== Should be stale ... and is ====
   
   ```
   [16:14:07 httpbin]$ curl -sIXGET --resolve httpbin.local:80:127.0.0.1 "http://httpbin.local/response-headers?cache-control=s-maxage=10,must-revalidate,max-age=0"
   
   HTTP/1.1 200 OK
   Server: ATS/8.1.2
   Date: Thu, 08 Apr 2021 23:14:11 GMT
   Content-Type: application/json
   Content-Length: 130
   cache-control: s-maxage=10,must-revalidate,max-age=0
   Access-Control-Allow-Origin: *
   Access-Control-Allow-Credentials: true
   X-B3-TraceId: a9c9b25db39da964
   Strict-Transport-Security: max-age=31536000
   Age: 0
   Connection: keep-alive
   Via: https/1.1 milesserver (ApacheTrafficServer/8.1.2 [uScSsSfUpSeN:t cCSp sS])
   X-Cache-Key: https://httpbin.org/response-headers?cache-control=s-maxage=10,must-revalidate,max-age=0
   X-Cache: hit-stale
   X-Remap: from=http://httpbin.local/, to=https://httpbin.org/
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] mlibbey edited a comment on issue #7671: Caching doesn't seem to work

Posted by GitBox <gi...@apache.org>.
mlibbey edited a comment on issue #7671:
URL: https://github.com/apache/trafficserver/issues/7671#issuecomment-816349847


   I have a theory. You show you are using curl -I... I bet you are seeing it cache after a request that doesn't have the -I. (curl -I issues a HEAD request. HEAD requests don't fill the cache -- a GET request is needed to fill. Can you try `curl -o/dev/null -D-  --resolve meta.miraheze.org:443:127.0.0.1 https://meta.miraheze.org/wiki/Main_Page` ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org