[jira] [Commented] (TS-4334) The cache_range_requests plugin always attempts to modify the cache key.
[ https://issues.apache.org/jira/browse/TS-4334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15510517#comment-15510517 ] Gancho Tenev commented on TS-4334: -- [~jamesf], sounds good. The above solution was just to demonstrate the idea, you would need to adjust it to your particular use-case and verify if it works. Cheers, --Gancho > The cache_range_requests plugin always attempts to modify the cache key. > > > Key: TS-4334 > URL: https://issues.apache.org/jira/browse/TS-4334 > Project: Traffic Server > Issue Type: Improvement > Components: Plugins >Reporter: Nolan Astrein >Assignee: Gancho Tenev > Fix For: 7.1.0 > > > A TrafficServer administrator should be able to specify whether or not the > cache_range_requests plugin should modify the cache key. The cache key may > be modified by a previous plugin in a plugin chain and there is no way to > configure cache_range_requests not to do any further modifications to the > cache key. Having multiple plugins responsible for cache key modifications > can cause unexpected behavior, especially when a plugin chain ordering is > changed. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TS-4334) The cache_range_requests plugin always attempts to modify the cache key.
[ https://issues.apache.org/jira/browse/TS-4334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15509442#comment-15509442 ] James Fang commented on TS-4334: should we change : cond %{SEND_RESPONSE_HDR_HOOK} cond %{STATUS} =200 set-status 206 to cond %{SEND_RESPONSE_HDR_HOOK} cond %{CLIENT-HEADER:@Original-Range} [NOT,AND] cond %{STATUS} =200 set-status 206 to avoid changing status for no range request ? > The cache_range_requests plugin always attempts to modify the cache key. > > > Key: TS-4334 > URL: https://issues.apache.org/jira/browse/TS-4334 > Project: Traffic Server > Issue Type: Improvement > Components: Plugins >Reporter: Nolan Astrein >Assignee: Gancho Tenev > Fix For: 7.1.0 > > > A TrafficServer administrator should be able to specify whether or not the > cache_range_requests plugin should modify the cache key. The cache key may > be modified by a previous plugin in a plugin chain and there is no way to > configure cache_range_requests not to do any further modifications to the > cache key. Having multiple plugins responsible for cache key modifications > can cause unexpected behavior, especially when a plugin chain ordering is > changed. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TS-4334) The cache_range_requests plugin always attempts to modify the cache key.
[ https://issues.apache.org/jira/browse/TS-4334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15509371#comment-15509371 ] James Fang commented on TS-4334: cache_range_local.config will change a 200 status to 206, so we may need add another condition: cond %{SEND_RESPONSE_HDR_HOOK} cond %{CLIENT-HEADER:Range} AND # only match range request cond %{STATUS} =200 set-status 206 > The cache_range_requests plugin always attempts to modify the cache key. > > > Key: TS-4334 > URL: https://issues.apache.org/jira/browse/TS-4334 > Project: Traffic Server > Issue Type: Improvement > Components: Plugins >Reporter: Nolan Astrein >Assignee: Gancho Tenev > Fix For: 7.1.0 > > > A TrafficServer administrator should be able to specify whether or not the > cache_range_requests plugin should modify the cache key. The cache key may > be modified by a previous plugin in a plugin chain and there is no way to > configure cache_range_requests not to do any further modifications to the > cache key. Having multiple plugins responsible for cache key modifications > can cause unexpected behavior, especially when a plugin chain ordering is > changed. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TS-4334) The cache_range_requests plugin always attempts to modify the cache key.
[ https://issues.apache.org/jira/browse/TS-4334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15506710#comment-15506710 ] James Fang commented on TS-4334: Gancho, sorry for the delay, i was meaning that this is a invalid bug report according to my experiments. and thanks for your explanation, i am going to convert my current approach (which uses cache_range_request ) to yours. > The cache_range_requests plugin always attempts to modify the cache key. > > > Key: TS-4334 > URL: https://issues.apache.org/jira/browse/TS-4334 > Project: Traffic Server > Issue Type: Improvement > Components: Plugins >Reporter: Nolan Astrein >Assignee: Gancho Tenev > Fix For: 7.1.0 > > > A TrafficServer administrator should be able to specify whether or not the > cache_range_requests plugin should modify the cache key. The cache key may > be modified by a previous plugin in a plugin chain and there is no way to > configure cache_range_requests not to do any further modifications to the > cache key. Having multiple plugins responsible for cache key modifications > can cause unexpected behavior, especially when a plugin chain ordering is > changed. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TS-4334) The cache_range_requests plugin always attempts to modify the cache key.
[ https://issues.apache.org/jira/browse/TS-4334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15505097#comment-15505097 ] Gancho Tenev commented on TS-4334: -- Checked with [~latesonarinn] offline and here is an excerpt: 9/16/16, 12:06 PM Gancho Tenev: {quote} Proposed alternative solution using more generic means (cachekey and header_rewrite) here: [TS-4334|https://issues.apache.org/jira/browse/TS-4334] Could you please let me know if it works for you? {quote} 9/19/16, 9:59 AM Nolan Astrein: {quote} Clever solution. I think that will work. {quote} [~latesonarinn], could you please verify and/or close this Jira if all looks good? (if not please let me know if I can help!) Cheers! > The cache_range_requests plugin always attempts to modify the cache key. > > > Key: TS-4334 > URL: https://issues.apache.org/jira/browse/TS-4334 > Project: Traffic Server > Issue Type: Improvement > Components: Plugins >Reporter: Nolan Astrein >Assignee: Gancho Tenev > Fix For: 7.1.0 > > > A TrafficServer administrator should be able to specify whether or not the > cache_range_requests plugin should modify the cache key. The cache key may > be modified by a previous plugin in a plugin chain and there is no way to > configure cache_range_requests not to do any further modifications to the > cache key. Having multiple plugins responsible for cache key modifications > can cause unexpected behavior, especially when a plugin chain ordering is > changed. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TS-4334) The cache_range_requests plugin always attempts to modify the cache key.
[ https://issues.apache.org/jira/browse/TS-4334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15468540#comment-15468540 ] Gancho Tenev commented on TS-4334: -- [~jamesf], I am sorry if I did not make my idea/example clear enough! I was proposing not to use {{cache_range_requests}} plugin at all and use {{cachekey}} plugin as your central place of cache key manipulation and then by using the {{header_rewrite}} plugin to implement the rest of the logic done by the {{cache_range_requests}} (adding/removing the Range header at different hooks). The end result should be practically the same as using {{cache_range_requests}} plugin but achieved by using more generic plugins (tested it) instead of hacking into {{cache_range_requests}} which seems pretty specialized and less configurable. I was wondering if this would work for you. Please let me know, I would gladly help you if any problems/concerns. Cheers! > The cache_range_requests plugin always attempts to modify the cache key. > > > Key: TS-4334 > URL: https://issues.apache.org/jira/browse/TS-4334 > Project: Traffic Server > Issue Type: Improvement > Components: Plugins >Reporter: Nolan Astrein >Assignee: Gancho Tenev > Fix For: 7.1.0 > > > A TrafficServer administrator should be able to specify whether or not the > cache_range_requests plugin should modify the cache key. The cache key may > be modified by a previous plugin in a plugin chain and there is no way to > configure cache_range_requests not to do any further modifications to the > cache key. Having multiple plugins responsible for cache key modifications > can cause unexpected behavior, especially when a plugin chain ordering is > changed. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TS-4334) The cache_range_requests plugin always attempts to modify the cache key.
[ https://issues.apache.org/jira/browse/TS-4334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15466981#comment-15466981 ] James Fang commented on TS-4334: it seems to me that cache key can only be set once ? reason: 1) in TSCacheUrlSet, it check if cache url is NULL 2) from my testing, ( cachekey.so cache_range_requests.so, in this order in remap.config ), there is the following error log: [Sep 6 09:30:55.813] Server {0x2b5221c5ffc0} DIAG: (cache_range_requests) [cache_range_requests.cc:110] range_header_check(): failed to change the cache url to indicates that changing of cache url failed. > The cache_range_requests plugin always attempts to modify the cache key. > > > Key: TS-4334 > URL: https://issues.apache.org/jira/browse/TS-4334 > Project: Traffic Server > Issue Type: Improvement > Components: Plugins >Reporter: Nolan Astrein >Assignee: Gancho Tenev > Fix For: 7.1.0 > > > A TrafficServer administrator should be able to specify whether or not the > cache_range_requests plugin should modify the cache key. The cache key may > be modified by a previous plugin in a plugin chain and there is no way to > configure cache_range_requests not to do any further modifications to the > cache key. Having multiple plugins responsible for cache key modifications > can cause unexpected behavior, especially when a plugin chain ordering is > changed. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TS-4334) The cache_range_requests plugin always attempts to modify the cache key.
[ https://issues.apache.org/jira/browse/TS-4334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15441913#comment-15441913 ] Gancho Tenev commented on TS-4334: -- It seems to me that the {{cache_range_requests}} functionality can be achieved by using more generic (and feature-rich) plugins like {{header_rewrite}} and {{cachekey}}. Here is a sample where {{httpbin.org}} is used as origin which responds to range requests adding {{Cache-Control:max-age=10}} header. There are 2 remap rules defined, one for {{example_no_cache.com}} which is non-caching (ATS does not cache 206 responses by default) and one for {{example.com}} which is caching exactly like the {{cache_range_requests}} plugin does. To test run {{traffic_server}} and {{curl}} 4 times every 5 seconds - 2 times to test the non-caching remap and 2 times to test the "cache_range_requests"-style caching. Here are the configs: {code} $ cat etc/trafficserver/remap.config map http://example.com http://httpbin.org \ @plugin=cachekey.so @pparam=--include-headers=@Original-Range \ @plugin=header_rewrite.so @pparam=cache_range_local.config map http://example_no_cache.com http://httpbin.org \ @plugin=cachekey.so $ cat etc/trafficserver/cache_range_global.config cond %{READ_REQUEST_HDR_HOOK} cond %{CLIENT-URL:HOST} example.com set-header @Original-Range %{HEADER:Range} rm-header Range $ cat etc/trafficserver/cache_range_local.config cond %{SEND_REQUEST_HDR_HOOK} set-header Range %{HEADER:@Original-Range} cond %{READ_RESPONSE_HDR_HOOK} cond %{STATUS} =206 set-status 200 set-header Cache-Control "max-age=10" cond %{SEND_RESPONSE_HDR_HOOK} cond %{STATUS} =200 set-status 206 $ cat etc/trafficserver/plugin.config header_rewrite.so cache_range_global.config xdebug.so {code} And here is a sample test: {code} $ sudo ./bin/traffic_server -T 'header_rewrite|cachekey' --clear_cache . . . $ for domain in example_no_cache.com example_no_cache.com example.com example.com; do curl -x 127.0.0.1:80 -v "http://${domain}/range/1024"; -H "X-Debug: X-Cache,X-Cache-Key" -r0-16 -s 2>&1|grep -e "HTTP" -e "Cache"; echo "---"; sleep 5; done > GET http://example_no_cache.com/range/1024 HTTP/1.1 > X-Debug: X-Cache,X-Cache-Key < HTTP/1.1 206 PARTIAL CONTENT < X-Cache-Key: /example_no_cache.com/80/range/1024 < X-Cache: miss --- > GET http://example_no_cache.com/range/1024 HTTP/1.1 > X-Debug: X-Cache,X-Cache-Key < HTTP/1.1 206 PARTIAL CONTENT < X-Cache-Key: /example_no_cache.com/80/range/1024 < X-Cache: miss --- > GET http://example.com/range/1024 HTTP/1.1 > X-Debug: X-Cache,X-Cache-Key < HTTP/1.1 206 Partial Content < Cache-Control: max-age=10 < X-Cache-Key: /example.com/80/@Original-Range:bytes=0-16/range/1024 < X-Cache: miss --- > GET http://example.com/range/1024 HTTP/1.1 > X-Debug: X-Cache,X-Cache-Key < HTTP/1.1 206 Partial Content < Cache-Control: max-age=10 < X-Cache-Key: /example.com/80/@Original-Range:bytes=0-16/range/1024 < X-Cache: hit-fresh --- {code} Please let me know if it works for you! Cheers, --Gancho > The cache_range_requests plugin always attempts to modify the cache key. > > > Key: TS-4334 > URL: https://issues.apache.org/jira/browse/TS-4334 > Project: Traffic Server > Issue Type: Improvement > Components: Plugins >Reporter: Nolan Astrein >Assignee: Gancho Tenev > Fix For: 7.1.0 > > > A TrafficServer administrator should be able to specify whether or not the > cache_range_requests plugin should modify the cache key. The cache key may > be modified by a previous plugin in a plugin chain and there is no way to > configure cache_range_requests not to do any further modifications to the > cache key. Having multiple plugins responsible for cache key modifications > can cause unexpected behavior, especially when a plugin chain ordering is > changed. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TS-4334) The cache_range_requests plugin always attempts to modify the cache key.
[ https://issues.apache.org/jira/browse/TS-4334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15231444#comment-15231444 ] Gancho Tenev commented on TS-4334: -- Sure, please assign it to me. > The cache_range_requests plugin always attempts to modify the cache key. > > > Key: TS-4334 > URL: https://issues.apache.org/jira/browse/TS-4334 > Project: Traffic Server > Issue Type: Improvement > Components: Plugins >Reporter: Nolan Astrein > Fix For: 7.0.0 > > > A TrafficServer administrator should be able to specify whether or not the > cache_range_requests plugin should modify the cache key. The cache key may > be modified by a previous plugin in a plugin chain and there is no way to > configure cache_range_requests not to do any further modifications to the > cache key. Having multiple plugins responsible for cache key modifications > can cause unexpected behavior, especially when a plugin chain ordering is > changed. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TS-4334) The cache_range_requests plugin always attempts to modify the cache key.
[ https://issues.apache.org/jira/browse/TS-4334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15231217#comment-15231217 ] Leif Hedstrom commented on TS-4334: --- [~gancho] Would you like to shepherd this as well? We can expect a PR on this soonish. > The cache_range_requests plugin always attempts to modify the cache key. > > > Key: TS-4334 > URL: https://issues.apache.org/jira/browse/TS-4334 > Project: Traffic Server > Issue Type: Improvement > Components: Plugins >Reporter: Nolan Astrein > Fix For: 7.0.0 > > > A TrafficServer administrator should be able to specify whether or not the > cache_range_requests plugin should modify the cache key. The cache key may > be modified by a previous plugin in a plugin chain and there is no way to > configure cache_range_requests not to do any further modifications to the > cache key. Having multiple plugins responsible for cache key modifications > can cause unexpected behavior, especially when a plugin chain ordering is > changed. -- This message was sent by Atlassian JIRA (v6.3.4#6332)