masaori335 commented on PR #14025:
URL: https://github.com/apache/trafficserver/pull/14025#issuecomment-6964455725

   Before the line-level concerns, I'd like to question the shape. Could a 
procedure do this instead of a new section?
   
   The main problem in the description is that every branch repeats the full 
cachekey.so flag list. A procedure keeps the shared flags in one place, and 
each branch passes only what differs:
   
   ```
   procedure site::key($extra="") {
       run-plugin("cachekey.so", "--key-type=cache_key,parent_selection_url", 
"--sort-params=true --include-headers=Origin", "$extra");
   }
   REMAP {
       ...
       if inbound.req.Host == "api.example.com" {
           site::key("--include-cookies=locale");
       } else {
           site::key();
       }
   }
   ```
   
   This compiles to the same per-branch run-plugin lines, with no new compiler 
code and no key parts the compiler makes up. What does the section give that a 
procedure can'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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to