Leif Hedstrom created TS-2686:
---------------------------------

             Summary: Change hooks for background_fetch to run after 
READ_RESPONSE_HDR txn's
                 Key: TS-2686
                 URL: https://issues.apache.org/jira/browse/TS-2686
             Project: Traffic Server
          Issue Type: Improvement
          Components: Plugins
            Reporter: Leif Hedstrom


We're having an issue, where transaction hooks in READ_RESPONSE_HDR modifies 
the Cache-Control: header. Because of how hooks are executed (in the order they 
were added), the global hook in background_fetch runes before these. The 
problem then becomes that the content is not cacheable, because our 
modifications have not taken place.

I'm going to modify it such that the following happens:

1. We run a global hook in READ_RESPONSE_HDR, which checks if the response is a 
206. If it is, we schedule a TXN hook for SEND_RESPONSE_HDR hook.

2. In the TXN hook for SEND_RESPONSE_HDR, we check if the request / response is 
now cacheable, and if so, we schedule the actual background fetch.


This is not the "easiest" solution, but it's the most efficient one. The other 
option would be to simply change the existing code to just move the global hook 
to SEND_RESPONSE_HDR hook. But this is less efficient, since it'd trigger for 
every response, even those served out of cache.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to