# Calculating backend time to total time - case of redirect (status code 302)

**URL:** <https://discuss.httparchive.org/t/calculating-backend-time-to-total-time-case-of-redirect-status-code-302/1784>\
**Category:** Analysis\
**Created:** [November 4, 2019, 3:37pm UTC](https://discuss.httparchive.org/t/calculating-backend-time-to-total-time-case-of-redirect-status-code-302/1784 "2019-11-04T15:37:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![raghuramakrishnan](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.httparchive.org/raghuramakrishnan/32/924_2.png) [@raghuramakrishnan](https://discuss.httparchive.org/u/raghuramakrishnan)\
**Post date:** [November 4, 2019, 3:37pm UTC](https://discuss.httparchive.org/t/calculating-backend-time-to-total-time-case-of-redirect-status-code-302/1784/1 "2019-11-04T15:37:13Z")

</div>

Inspection of onLoad and tffb appears to show a few anomalies w.r.t 20-80 rules.  
Enclosing three random cases, where the reason appears to be redirects? In the cases, the ttfb \>\> onLoad. All the cases have 1-2 redirects before the actual HTML is served.

Date: 2018\_03\_15\_desktop

SELECT  
pageid, time, status, type, format  
FROM  
`httparchive.summary_requests.2018_03_15_desktop`  
WHERE  
pageid IN (87277828, 87291432, 87267343)  
ORDER BY pageid

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/httparchive/original/2X/3/3a6f200eceb6e75cfcbbffe97463faae2dab7947.png)

87277828 onLoad=340/ttfb=478  
87267343 onLoad=352/ttfb=1939  
87291432 onLoad=212/ttfb=570

The ttfb appears to include the time taken by all the HTML requests (including redirects), but the onLoad appears to be for the last HTML.  
In such a case calculating ttfb/onLoad for the backend/total time ratio may include a bit of error. Using the ttfb of the HTML with 200 status (by looking at the requests summary table) may be more accurate.
