You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2020/04/22 17:24:18 UTC

[GitHub] [trafficcontrol] srijeet0406 opened a new pull request #4657: CDN-6167: Allow support for "If-Modified-Since" on GET requests

srijeet0406 opened a new pull request #4657:
URL: https://github.com/apache/trafficcontrol/pull/4657


   <!--
   ************ STOP!! ************
   If this Pull Request is intended to fix a security vulnerability, DO NOT submit it! Instead, contact
   the Apache Software Foundation Security Team at security@trafficcontrol.apache.org and follow the
   guidelines at https://www.apache.org/security/ regarding vulnerability disclosure.
   -->
   ## What does this PR (Pull Request) do?
   <!-- Explain the changes you made here. If this fixes an Issue, identify it by
   replacing the text in the checkbox item with the Issue number e.g.
   
   - [x] This PR fixes #9001 OR is not related to any Issue
   
   ^ This will automatically close Issue number 9001 when the Pull Request is
   merged (The '#' is important).
   
   Be sure you check the box properly, see the "The following criteria are ALL
   met by this PR" section for details.
   -->
   
   - [x] This PR is related to #3509
   
   ## Which Traffic Control components are affected by this PR?
   <!-- Please delete all components from this list that are NOT affected by this
   Pull Request. Also, feel free to add the name of a tool or script that is
   affected but not on the list.
   
   Additionally, if this Pull Request does NOT affect documentation, please
   explain why documentation is not required. -->
   
   - Traffic Ops
   
   ## What is the best way to verify this PR?
   <!-- Please include here ALL the steps necessary to test your Pull Request. If
   it includes tests (and most should), outline here the steps needed to run the
   tests. If not, lay out the manual testing procedure and please explain why
   tests are unnecessary for this Pull Request. -->
   You can either test it on your local setup or CiaB.
   Here's what I did:
   Once you have TO running, make a call to the "GET all" endpoint for any of the resources to get all the items. 
   Now, add a new item to the DB either via the TP UI or via a POST call. Now, do the "GET all" call with a header of "If-Modified-Since" specifying a date which is just BEFORE the time of creation of this last resource. Since this is a "GET all" call, it would still return "ALL" of the resources, since its a bulk read. Now, make a GET call for that last resource by ID, with a header of "If-Modified-Since" specifying a date which is just AFTER the time of creation of this last resource. This time, it should just return an empty response with a status code of 304 (NOT MODIFIED).
   
   ## If this is a bug fix, what versions of Traffic Control are affected?
   <!-- If this PR fixes a bug, please list here all of the affected versions - to
   the best of your knowledge. It's also pretty helpful to include a commit hash
   of where 'master' is at the time this PR is opened (if it affects master),
   because what 'master' means will change over time. For example, if this PR
   fixes a bug that's present in master (at commit hash '1df853c8'), in v4.0.0,
   and in the current 4.0.1 Release candidate (e.g. RC1), then this list would
   look like:
   
   - master (1df853c8)
   - 4.0.0
   - 4.0.1 (RC1)
   
   If you don't know what other versions might have this bug, AND don't know how
   to find the commit hash of 'master', then feel free to leave this section
   blank (or, preferably, delete it entirely).
    -->
   
   
   ## The following criteria are ALL met by this PR
   <!-- Check the boxes to signify that the associated statement is true. To
   "check a box", replace the space inside of the square brackets with an 'x'.
   e.g.
   
   - [ x] <- Wrong
   - [x ] <- Wrong
   - [] <- Wrong
   - [*] <- Wrong
   - [x] <- Correct!
   
   -->
   
   - [x] This PR includes tests
   - [x] This PR includes documentation
   - [x] This PR includes an update to CHANGELOG.md
   - [x] This PR includes any and all required license headers
   - [x] This PR does not include a database migration
   - [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://www.apache.org/security/) for details)
   
   
   ## Additional Information
   <!-- If you would like to include any additional information on the PR for
   potential reviewers please put it here.
   
   Some examples of this would be:
   
   - Before and after screenshots/gifs of the Traffic Portal if it is affected
   - Links to other dependent Pull Requests
   - References to relevant context (e.g. new/updates to dependent libraries,
   mailing list records, blueprints)
   
   Feel free to leave this section blank (or, preferably, delete it entirely).
   -->
   
   <!--
   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.

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



[GitHub] [trafficcontrol] rob05c commented on a change in pull request #4657: Allow support for "If-Modified-Since" on GET requests

Posted by GitBox <gi...@apache.org>.
rob05c commented on a change in pull request #4657:
URL: https://github.com/apache/trafficcontrol/pull/4657#discussion_r413217414



##########
File path: traffic_ops/traffic_ops_golang/apitenant/tenant.go
##########
@@ -122,7 +123,18 @@ func (ten TOTenant) Validate() error {
 
 func (tn *TOTenant) Create() (error, error, int) { return api.GenericCreate(tn) }
 
-func (ten *TOTenant) Read() ([]interface{}, error, error, int) {
+func (ten *TOTenant) Read(h map[string][]string) ([]interface{}, error, error, int) {
+	ims := h["If-Modified-Since"]
+	var modifiedSince time.Time
+	modified := false
+	found := false
+	code := http.StatusOK
+
+	if ims != nil && len(ims) != 0 {
+		if t, err := time.Parse(time.RFC1123, ims[0]); err == nil {

Review comment:
       This isn't sufficient, HTTP Dates can be several formats. There's an existing function you can  use: https://github.com/apache/trafficcontrol/blob/7f5346618daa4d98b7fd1cf9f674650fb7fa6f7f/grove/web/util.go#L185
   
   Which should probably be moved to `lib/go-rfc`.
   
   See https://tools.ietf.org/html/rfc7231#section-7.1.1.1




----------------------------------------------------------------
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] [trafficcontrol] rob05c commented on issue #4657: Allow support for "If-Modified-Since" on GET requests

Posted by GitBox <gi...@apache.org>.
rob05c commented on issue #4657:
URL: https://github.com/apache/trafficcontrol/pull/4657#issuecomment-617963513


   >Does this fix #3509
   
   It doesn't look like it. It looks like it just adds IMS, not If-Unmodified-Since or If-Match.
   
   But it should make it much easier to, since it adds the modification logic necessary, should just be a matter of adding the header logic for IUS+IM.
   
   Same for ETags and If-None-Match, which allow more precise matching. I have a PR with the code for generating and matching ETags, it shouldn't be too difficult to integrate it with this:
   https://github.com/apache/trafficcontrol/blob/5379f97aed6d137cc79b8c517a5601fe3c02beeb/lib/go-rfc/cachecontrol.go


----------------------------------------------------------------
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] [trafficcontrol] srijeet0406 commented on a change in pull request #4657: Allow support for "If-Modified-Since" on GET requests

Posted by GitBox <gi...@apache.org>.
srijeet0406 commented on a change in pull request #4657:
URL: https://github.com/apache/trafficcontrol/pull/4657#discussion_r413258197



##########
File path: traffic_ops/traffic_ops_golang/servercapability/servercapability.go
##########
@@ -100,6 +102,30 @@ func (v *TOServerCapability) Validate() error {
 	return util.JoinErrs(tovalidate.ToErrors(errs))
 }
 
-func (v *TOServerCapability) Read() ([]interface{}, error, error, int) { return api.GenericRead(v) }
-func (v *TOServerCapability) Create() (error, error, int)              { return api.GenericCreateNameBasedID(v) }
-func (v *TOServerCapability) Delete() (error, error, int)              { return api.GenericDelete(v) }
+func (v *TOServerCapability) Read(h map[string][]string) ([]interface{}, error, error, int) {
+	ims := h["If-Modified-Since"]
+	var modifiedSince time.Time
+	var res []interface{}
+
+	if ims == nil || len(ims) == 0 {
+		return api.GenericRead(v)

Review comment:
       Yeah, I was just talking to Brennan about it, and thats the reason I marked this PR as a draft, because I'm trying to see if we can do it all in the GenericReader code. That way, we just make the call to the DB and dont have to copy the same code changes everywhere.




----------------------------------------------------------------
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] [trafficcontrol] ocket8888 commented on issue #4657: Allow support for "If-Modified-Since" on GET requests

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on issue #4657:
URL: https://github.com/apache/trafficcontrol/pull/4657#issuecomment-617965812


   Yeah, he PM'd me. Just wanted to be sure that if this did it would auto-close the issue on merge. But it doesn't so all's good.


----------------------------------------------------------------
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] [trafficcontrol] ocket8888 commented on a change in pull request #4657: Allow support for "If-Modified-Since" on GET requests

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #4657:
URL: https://github.com/apache/trafficcontrol/pull/4657#discussion_r414142043



##########
File path: traffic_ops/traffic_ops_golang/apitenant/tenant.go
##########
@@ -122,7 +123,18 @@ func (ten TOTenant) Validate() error {
 
 func (tn *TOTenant) Create() (error, error, int) { return api.GenericCreate(tn) }
 
-func (ten *TOTenant) Read() ([]interface{}, error, error, int) {
+func (ten *TOTenant) Read(h map[string][]string) ([]interface{}, error, error, int) {
+	ims := h["If-Modified-Since"]
+	var modifiedSince time.Time
+	modified := false
+	found := false
+	code := http.StatusOK
+
+	if ims != nil && len(ims) != 0 {

Review comment:
       `len(nil) == 0` so you don't need to check both

##########
File path: traffic_ops/traffic_ops_golang/apitenant/tenant.go
##########
@@ -143,10 +155,22 @@ func (ten *TOTenant) Read() ([]interface{}, error, error, int) {
 			// root tenant has no parent
 			continue
 		}
+		found = true
 		p := *tenantNames[*t.ParentID]
+		// In case of a bulk read, even if one of the items has a "lastUpdated" time that is after whats supplied in the request,
+		// we send back the entire array of results
+		if !t.LastUpdated.Before(modifiedSince) {
+			modified = true
+		}
 		t.ParentName = &p // copy
 	}
-	return tenants, nil, nil, http.StatusOK
+	// If the modified flag stayed false throughout (meaning that all the items' "lastUpdated" time is before whats supplied in the request),
+	// we send back a 304, with an empty response
+	if modified == false && found == true {
+		code = http.StatusNotModified
+		tenants = []interface{}{}
+	}
+	return tenants, nil, nil, code

Review comment:
       this logic looks like if no IMS header is sent in the request it will send back a Not Modified response.




----------------------------------------------------------------
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] [trafficcontrol] srijeet0406 commented on a change in pull request #4657: Allow support for "If-Modified-Since" on GET requests

Posted by GitBox <gi...@apache.org>.
srijeet0406 commented on a change in pull request #4657:
URL: https://github.com/apache/trafficcontrol/pull/4657#discussion_r413257377



##########
File path: traffic_ops/traffic_ops_golang/cachegroup/cachegroups.go
##########
@@ -426,10 +439,20 @@ func (cg *TOCacheGroup) Read() ([]interface{}, error, error, int) {
 		}
 		s.LocalizationMethods = &lms
 		s.Fallbacks = &cgfs
+		// In case of a bulk read, even if one of the items has a "lastUpdated" time that is after whats supplied in the request,
+		// we send back the entire array of results
+		if !s.LastUpdated.Before(modifiedSince) {

Review comment:
       Great catch, I'll work on fixing that




----------------------------------------------------------------
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] [trafficcontrol] rob05c commented on a change in pull request #4657: Allow support for "If-Modified-Since" on GET requests

Posted by GitBox <gi...@apache.org>.
rob05c commented on a change in pull request #4657:
URL: https://github.com/apache/trafficcontrol/pull/4657#discussion_r413224724



##########
File path: traffic_ops/traffic_ops_golang/servercapability/servercapability.go
##########
@@ -100,6 +102,30 @@ func (v *TOServerCapability) Validate() error {
 	return util.JoinErrs(tovalidate.ToErrors(errs))
 }
 
-func (v *TOServerCapability) Read() ([]interface{}, error, error, int) { return api.GenericRead(v) }
-func (v *TOServerCapability) Create() (error, error, int)              { return api.GenericCreateNameBasedID(v) }
-func (v *TOServerCapability) Delete() (error, error, int)              { return api.GenericDelete(v) }
+func (v *TOServerCapability) Read(h map[string][]string) ([]interface{}, error, error, int) {
+	ims := h["If-Modified-Since"]
+	var modifiedSince time.Time
+	var res []interface{}
+
+	if ims == nil || len(ims) == 0 {
+		return api.GenericRead(v)

Review comment:
       There seems to be a lot of very similar code around reads. How difficult would it be to reduce the duplication by putting the "modified" logic inside `api.GenericRead` somehow?




----------------------------------------------------------------
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] [trafficcontrol] rob05c commented on a change in pull request #4657: Allow support for "If-Modified-Since" on GET requests

Posted by GitBox <gi...@apache.org>.
rob05c commented on a change in pull request #4657:
URL: https://github.com/apache/trafficcontrol/pull/4657#discussion_r413227774



##########
File path: traffic_ops/traffic_ops_golang/cdnfederation/cdnfederations.go
##########
@@ -143,7 +144,18 @@ func checkTenancy(tenantID *int, tenantIDs []int) bool {
 	return false
 }
 
-func (fed *TOCDNFederation) Read() ([]interface{}, error, error, int) {
+func (fed *TOCDNFederation) Read(h map[string][]string) ([]interface{}, error, error, int) {
+	ims := h["If-Modified-Since"]
+	var modifiedSince time.Time
+	modified := false
+	found := false
+	code := http.StatusOK
+
+	if ims != nil && len(ims) != 0 {
+		if t, err := time.Parse(time.RFC1123, ims[0]); err == nil {

Review comment:
       It seems that nearly every endpoint needs this. Should we reduce the duplicated logic by having the HTTP Routing parse this and put it in the HTTP Context?




----------------------------------------------------------------
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] [trafficcontrol] ocket8888 commented on a change in pull request #4657: Allow support for "If-Modified-Since" on GET requests

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #4657:
URL: https://github.com/apache/trafficcontrol/pull/4657#discussion_r413234348



##########
File path: traffic_ops/traffic_ops_golang/apitenant/tenant.go
##########
@@ -122,7 +123,18 @@ func (ten TOTenant) Validate() error {
 
 func (tn *TOTenant) Create() (error, error, int) { return api.GenericCreate(tn) }
 
-func (ten *TOTenant) Read() ([]interface{}, error, error, int) {
+func (ten *TOTenant) Read(h map[string][]string) ([]interface{}, error, error, int) {
+	ims := h["If-Modified-Since"]
+	var modifiedSince time.Time
+	modified := false
+	found := false
+	code := http.StatusOK
+
+	if ims != nil && len(ims) != 0 {
+		if t, err := time.Parse(time.RFC1123, ims[0]); err == nil {

Review comment:
       > _"Which should probably be moved to `lib/go-rfc`"_
   
   :+1: 




----------------------------------------------------------------
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] [trafficcontrol] ocket8888 commented on issue #4657: CDN-6167: Allow support for "If-Modified-Since" on GET requests

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on issue #4657:
URL: https://github.com/apache/trafficcontrol/pull/4657#issuecomment-617940042


   Does this fix #3509 ?


----------------------------------------------------------------
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] [trafficcontrol] rob05c commented on a change in pull request #4657: Allow support for "If-Modified-Since" on GET requests

Posted by GitBox <gi...@apache.org>.
rob05c commented on a change in pull request #4657:
URL: https://github.com/apache/trafficcontrol/pull/4657#discussion_r413216074



##########
File path: traffic_ops/traffic_ops_golang/apitenant/tenant.go
##########
@@ -122,7 +123,18 @@ func (ten TOTenant) Validate() error {
 
 func (tn *TOTenant) Create() (error, error, int) { return api.GenericCreate(tn) }
 
-func (ten *TOTenant) Read() ([]interface{}, error, error, int) {
+func (ten *TOTenant) Read(h map[string][]string) ([]interface{}, error, error, int) {
+	ims := h["If-Modified-Since"]

Review comment:
       Would you object to making this a constant in `lib/go-rfc`?




----------------------------------------------------------------
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] [trafficcontrol] rob05c commented on a change in pull request #4657: Allow support for "If-Modified-Since" on GET requests

Posted by GitBox <gi...@apache.org>.
rob05c commented on a change in pull request #4657:
URL: https://github.com/apache/trafficcontrol/pull/4657#discussion_r413228085



##########
File path: traffic_ops/traffic_ops_golang/cachegroup/cachegroups.go
##########
@@ -426,10 +439,20 @@ func (cg *TOCacheGroup) Read() ([]interface{}, error, error, int) {
 		}
 		s.LocalizationMethods = &lms
 		s.Fallbacks = &cgfs
+		// In case of a bulk read, even if one of the items has a "lastUpdated" time that is after whats supplied in the request,
+		// we send back the entire array of results
+		if !s.LastUpdated.Before(modifiedSince) {

Review comment:
       This isn't sufficient. If objects have been deleted, the endpoint won't be flagged as Modified, and will return a 304 when there have actually been changes.
   
   This needs to keep track of deleted rows somehow.
   
   There are several ways to do it. One would be to create a `deleted_foo` table for each existing table, tracking deletions. Possibly with a truncation routine, and logic to determine "if IMS request  is older than the oldest deletion/cleanup time, consider it modified.
   
   Another way is to make deletions update a "last modified" timestamp  on the endpoint somehow. This could be a simple table of timestamps for each table, or it could artificially update the timestamp of some row on another table which is part of the endpoint (for example, deliveryservices_regexes could update the timestamp of the deliveryservice they belong to, when one  is deleted). Possibly as a Database Trigger.
   
   Those are just ideas. As long as deletions are tracked, I don't have a strong opinion on how. 

##########
File path: traffic_ops/traffic_ops_golang/cachegroup/cachegroups.go
##########
@@ -426,10 +439,20 @@ func (cg *TOCacheGroup) Read() ([]interface{}, error, error, int) {
 		}
 		s.LocalizationMethods = &lms
 		s.Fallbacks = &cgfs
+		// In case of a bulk read, even if one of the items has a "lastUpdated" time that is after whats supplied in the request,
+		// we send back the entire array of results
+		if !s.LastUpdated.Before(modifiedSince) {

Review comment:
       This isn't sufficient. If objects have been deleted, the endpoint won't be flagged as Modified, and will return a 304 when there have actually been changes.
   
   This needs to keep track of deleted rows somehow.
   
   There are several ways to do it. One would be to create a `deleted_foo` table for each existing table, tracking deletions. Possibly with a truncation routine, and logic to determine "if IMS request  is older than the oldest deletion/truncation time, consider it modified.
   
   Another way is to make deletions update a "last modified" timestamp  on the endpoint somehow. This could be a simple table of timestamps for each table, or it could artificially update the timestamp of some row on another table which is part of the endpoint (for example, deliveryservices_regexes could update the timestamp of the deliveryservice they belong to, when one  is deleted). Possibly as a Database Trigger.
   
   Those are just ideas. As long as deletions are tracked, I don't have a strong opinion on how. 

##########
File path: traffic_ops/traffic_ops_golang/cachegroup/cachegroups.go
##########
@@ -426,10 +439,20 @@ func (cg *TOCacheGroup) Read() ([]interface{}, error, error, int) {
 		}
 		s.LocalizationMethods = &lms
 		s.Fallbacks = &cgfs
+		// In case of a bulk read, even if one of the items has a "lastUpdated" time that is after whats supplied in the request,
+		// we send back the entire array of results
+		if !s.LastUpdated.Before(modifiedSince) {

Review comment:
       This isn't sufficient. If objects have been deleted, the endpoint won't be flagged as Modified, and will return a 304 when there have actually been changes.
   
   This needs to keep track of deleted rows somehow.
   
   There are several ways to do it. One would be to create a `deleted_foo` table for each existing table, tracking deletions. Possibly with a truncation routine, and logic to determine "if IMS request  is older than the oldest deletion/truncation time, consider it modified."
   
   Another way is to make deletions update a "last modified" timestamp  on the endpoint somehow. This could be a simple table of timestamps for each table, or it could artificially update the timestamp of some row on another table which is part of the endpoint (for example, deliveryservices_regexes could update the timestamp of the deliveryservice they belong to, when one  is deleted). Possibly as a Database Trigger.
   
   Those are just ideas. As long as deletions are tracked, I don't have a strong opinion on how. 




----------------------------------------------------------------
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] [trafficcontrol] rob05c commented on a change in pull request #4657: Allow support for "If-Modified-Since" on GET requests

Posted by GitBox <gi...@apache.org>.
rob05c commented on a change in pull request #4657:
URL: https://github.com/apache/trafficcontrol/pull/4657#discussion_r413228085



##########
File path: traffic_ops/traffic_ops_golang/cachegroup/cachegroups.go
##########
@@ -426,10 +439,20 @@ func (cg *TOCacheGroup) Read() ([]interface{}, error, error, int) {
 		}
 		s.LocalizationMethods = &lms
 		s.Fallbacks = &cgfs
+		// In case of a bulk read, even if one of the items has a "lastUpdated" time that is after whats supplied in the request,
+		// we send back the entire array of results
+		if !s.LastUpdated.Before(modifiedSince) {

Review comment:
       This isn't sufficient. If objects have been deleted, the endpoint won't be flagged as Modified, and will return a 304 when there have actually been changes.
   
   This needs to keep track of deleted rows somehow.
   
   There are several ways to do it. One would be to create a `deleted_foo` table for each existing table, tracking deletions. Possibly with a cleanup routine, and logic to determine "if IMS request  is older than the oldest deletion/cleanup time, consider it modified.
   
   Another way is to make deletions update a "last modified" timestamp  on the endpoint somehow. This could be a simple table of timestamps for each table, or it could artificially update the timestamp of some row on another table which is part of the endpoint (for example, deliveryservices_regexes could update the timestamp of the deliveryservice they belong to, when one  is deleted). Possibly as a Database Trigger.
   
   Those are just ideas. As long as deletions are tracked, I don't have a strong opinion on how. 




----------------------------------------------------------------
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] [trafficcontrol] ocket8888 edited a comment on issue #4657: Allow support for "If-Modified-Since" on GET requests

Posted by GitBox <gi...@apache.org>.
ocket8888 edited a comment on issue #4657:
URL: https://github.com/apache/trafficcontrol/pull/4657#issuecomment-617940042


   Does this fix #3509 ?
   
   Update: it doesn't


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