* @brief Find out if the current response to trigger a background prefetch. * * Pre-fetch only on HTTP codes 200 and 206 or object found in cache (previous good response) * * @param txnp HTTP transaction structure * @return true - trigger prefetch, false - don't trigger. */
| 466 | * @return true - trigger prefetch, false - don't trigger. |
| 467 | */ |
| 468 | static bool |
| 469 | respToTriggerPrefetch(TSHttpTxn txnp) |
| 470 | { |
| 471 | bool trigger = false; |
| 472 | if (foundFresh(txnp)) { |
| 473 | /* If found in cache and fresh trigger next (same as good response from origin) */ |
| 474 | PrefetchDebug("trigger background fetch (cached)"); |
| 475 | trigger = true; |
| 476 | } else if (isResponseGood(txnp)) { |
| 477 | /* Trigger all necessary background fetches based on the next path pattern */ |
| 478 | PrefetchDebug("trigger background fetch (good origin response)"); |
| 479 | trigger = true; |
| 480 | } else { |
| 481 | PrefetchDebug("don't trigger background fetch"); |
| 482 | } |
| 483 | return trigger; |
| 484 | } |
| 485 | |
| 486 | /** |
| 487 | * @brief Callback function that handles necessary foreground / background fetch operations. |
no test coverage detected