graceguo-supercat edited a comment on pull request #10963:
URL: 
https://github.com/apache/incubator-superset/pull/10963#issuecomment-698043672


   `etag_cache` decorator works this way:
   
   - explore_json flow:
   
   1. http request come in
   
   1. check_slice_perms. No matter has cached response, if no permission, 
response with error.
   
   1. if method is POST, run query (not use cache). Otherwise check if this 
request has cache.
   
   1. if no cached response, run query and create a cache key for the response
   
   1. send response to client-side, with eTag header, last_modified header and 
expiration time header. last_modified time is now (response time).
   
   
   - dashboard flow:
   1. http request come in
   
   1. check_dashboard_perms. No matter has cached response, if no permission, 
response with error.
   
   1. if method is POST, or feature is not enabled, run dashboard function to 
build response (not use cache). Otherwise check if this request has cache.
   
   1. if no cached response, run dashboard function.
   
   1. if has cache, compare cached time with dashboard last modified time: it 
could be dashboard's metadata was changed (dashboard's changed_on), or any of 
its slices was changed (slice's changed_on). If cache is stale, run dashboard 
function.
   
   1. send response to client-side, with eTag header, last_modified header and 
expiration time header. last_modified time is max of (dashboard' changed_on and 
its slices changed_on)


----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to