You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by "AbdelrahmanElawady (via GitHub)" <gi...@apache.org> on 2023/09/01 17:51:30 UTC

[GitHub] [trafficcontrol] AbdelrahmanElawady opened a new pull request, #7771: Configure uncacheable delivery services in Varnish

AbdelrahmanElawady opened a new pull request, #7771:
URL: https://github.com/apache/trafficcontrol/pull/7771

   <!--
   Thank you for contributing! Please be sure to read our contribution guidelines: https://github.com/apache/trafficcontrol/blob/master/CONTRIBUTING.md
   If this closes or relates to an existing issue, please reference it using one of the following:
   
   Closes: #ISSUE
   Related: #ISSUE
   
   If this PR fixes a security vulnerability, DO NOT submit! Instead, contact
   the Apache Traffic Control Security Team at security@trafficcontrol.apache.org and follow the
   guidelines at https://apache.org/security regarding vulnerability disclosure.
   -->
   Skip caching delivery services with type `HTTP_NO_CACHE`.
   
   Closes: #7770 
   
   <!-- **^ Add meaningful description above** --><hr/>
   
   ## Which Traffic Control components are affected by this PR?
   <!-- Please delete all components from this list that are NOT affected by this PR.
   Feel free to add the name of a tool or script that is affected but not on the list.
   -->
   - Traffic Control Cache Config (`t3c`, formerly ORT)
   
   ## What is the best way to verify this PR?
   <!-- Please include here ALL the steps necessary to test your PR.
   If your PR has tests (and most should), provide the steps needed to run the tests.
   If not, please provide step-by-step instructions to test the PR manually and explain why your PR does not need tests. -->
   unit tests added.
   CIAB doesn't have a DS with no cache type, however if manually changed the DS [profile](https://github.com/apache/trafficcontrol/blob/master/infrastructure/cdn-in-a-box/traffic_ops_data/deliveryservices/010-demo1.json#L9) to `HTTP_NO_CACHE` requests should not be cached with Varnish.
   
   ## PR submission checklist
   - [x] This PR has tests <!-- If not, please delete this text and explain why this PR does not need tests. -->
   - [x] This PR has documentation <!-- If not, please delete this text and explain why this PR does not need documentation. -->
   - [ ] This PR has a CHANGELOG.md entry <!-- A fix for a bug from an ATC release, an improvement, or a new feature should have a changelog entry. -->
   - [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://apache.org/security) for details)
   
   <!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
   
       http://www.apache.org/licenses/LICENSE-2.0
   
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
   -->
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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


[GitHub] [trafficcontrol] limited commented on pull request #7771: Configure uncacheable delivery services in Varnish

Posted by "limited (via GitHub)" <gi...@apache.org>.
limited commented on PR #7771:
URL: https://github.com/apache/trafficcontrol/pull/7771#issuecomment-1716015873

   Here's the generated VCL from this change:
   ```
   sub vcl_recv {
   	if ((req.method == "PUSH" || req.method == "PURGE" || req.method == "DELETE") && !client.ip ~ allow_all) {
   		return (synth(405));
   	}
   	if (req.method == "PURGE") {
   		return (purge);
   	}
   	if (req.http.host == "edge.demo1.mycdn.ciab.test") {
   		set req.backend_hint = demo1.backend();
   	}
   	if (req.http.host == "video.demo2.mycdn.ciab.test") {
   		set req.backend_hint = demo2.backend();
   	}
   }
   sub vcl_backend_response {
   	if (bereq.http.host == "origin.infra.ciab.test") {
   		set beresp.uncacheable = true;
   	}
   }
   sub vcl_backend_fetch {
   	if (bereq.http.host == "edge.demo1.mycdn.ciab.test") {
   		set bereq.http.host = "origin.infra.ciab.test";
   	}
   	if (bereq.http.host == "video.demo2.mycdn.ciab.test") {
   		set bereq.http.host = "origin.infra.ciab.test";
   	}
   }
   ```
   
   Because the same origin is shared between both delivery services, this will mark all requests to `origin.infra.ciab.test` as uncacheable. 
   
   Is there a way we can restrict the DS_NO_CACHE behavior just to the appropriate delivery service? (Maybe based on `bereq.http.Host`?)


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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


[GitHub] [trafficcontrol] limited merged pull request #7771: Configure uncacheable delivery services in Varnish

Posted by "limited (via GitHub)" <gi...@apache.org>.
limited merged PR #7771:
URL: https://github.com/apache/trafficcontrol/pull/7771


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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


[GitHub] [trafficcontrol] limited commented on pull request #7771: Configure uncacheable delivery services in Varnish

Posted by "limited (via GitHub)" <gi...@apache.org>.
limited commented on PR #7771:
URL: https://github.com/apache/trafficcontrol/pull/7771#issuecomment-1716087393

   
   > Because the same origin is shared between both delivery services, this will mark all requests to `origin.infra.ciab.test` as uncacheable.
   > 
   
   After comparing with the existing ATS implementation, this matches current behavior, so keeping it for consistency. 


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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


[GitHub] [trafficcontrol] codecov[bot] commented on pull request #7771: Configure uncacheable delivery services in Varnish

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #7771:
URL: https://github.com/apache/trafficcontrol/pull/7771#issuecomment-1703127409

   ## [Codecov](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#7771](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (0e1d5a9) into [master](https://app.codecov.io/gh/apache/trafficcontrol/commit/75ec56fa1bc4cf9c9e9ba54bde92197d4381649d?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (75ec56f) will **decrease** coverage by `26.98%`.
   > Report is 102 commits behind head on master.
   > The diff coverage is `50.10%`.
   
   ```diff
   @@              Coverage Diff              @@
   ##             master    #7771       +/-   ##
   =============================================
   - Coverage     65.05%   38.07%   -26.98%     
     Complexity       98       98               
   =============================================
     Files           314      422      +108     
     Lines         12365    34032    +21667     
     Branches        907       90      -817     
   =============================================
   + Hits           8044    12958     +4914     
   - Misses         3968    19898    +15930     
   - Partials        353     1176      +823     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [golib_unit](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `53.66% <59.33%> (?)` | |
   | [grove_unit](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `12.02% <ø> (?)` | |
   | [t3c_unit](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `5.99% <3.31%> (?)` | |
   | [traffic_monitor_unit](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `26.33% <0.00%> (?)` | |
   | [traffic_portal_v2](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [traffic_stats_unit](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `10.78% <ø> (?)` | |
   | [unit_tests](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `32.18% <50.10%> (-41.60%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Files Changed](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [cache-config/t3c-apply/config/config.go](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y2FjaGUtY29uZmlnL3QzYy1hcHBseS9jb25maWcvY29uZmlnLmdv) | `0.00% <0.00%> (ø)` | |
   | [cache-config/t3c-apply/torequest/cmd.go](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y2FjaGUtY29uZmlnL3QzYy1hcHBseS90b3JlcXVlc3QvY21kLmdv) | `0.00% <0.00%> (ø)` | |
   | [cache-config/t3c-check-refs/t3c-check-refs.go](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y2FjaGUtY29uZmlnL3QzYy1jaGVjay1yZWZzL3QzYy1jaGVjay1yZWZzLmdv) | `1.78% <0.00%> (ø)` | |
   | [cache-config/t3c-generate/cfgfile/varnish.go](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y2FjaGUtY29uZmlnL3QzYy1nZW5lcmF0ZS9jZmdmaWxlL3Zhcm5pc2guZ28=) | `0.00% <0.00%> (ø)` | |
   | [cache-config/t3c-generate/config/config.go](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y2FjaGUtY29uZmlnL3QzYy1nZW5lcmF0ZS9jb25maWcvY29uZmlnLmdv) | `0.81% <0.00%> (-0.08%)` | :arrow_down: |
   | [cache-config/t3c-generate/t3c-generate.go](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y2FjaGUtY29uZmlnL3QzYy1nZW5lcmF0ZS90M2MtZ2VuZXJhdGUuZ28=) | `0.00% <ø> (ø)` | |
   | [lib/go-atscfg/parentabstraction.go](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bGliL2dvLWF0c2NmZy9wYXJlbnRhYnN0cmFjdGlvbi5nbw==) | `80.00% <ø> (ø)` | |
   | [lib/go-tc/cdns.go](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bGliL2dvLXRjL2NkbnMuZ28=) | `0.00% <ø> (ø)` | |
   | [lib/go-tc/deliveryservice\_servers.go](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bGliL2dvLXRjL2RlbGl2ZXJ5c2VydmljZV9zZXJ2ZXJzLmdv) | `0.00% <0.00%> (ø)` | |
   | [lib/go-tc/federation\_resolver.go](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bGliL2dvLXRjL2ZlZGVyYXRpb25fcmVzb2x2ZXIuZ28=) | `45.45% <0.00%> (ø)` | |
   | ... and [20 more](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | |
   
   ... and [300 files with indirect coverage changes](https://app.codecov.io/gh/apache/trafficcontrol/pull/7771/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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