Live data from Hacker News

Ask HN: Why does 'View Source' issue a new HTTP request?

news.ycombinator.com

11–20 of 97 posts

Re: Ask HN: Why does 'View Source' issue a new HTTP request?

#11
post #2

I usually have Fiddler running constantly in the background. If a page is slow to load and I want to see the HTML, I would find the actual HTTP request in fiddler and grab the HTML that way. Alternatively, the element inspector doesn't re-issue the request, but it will show the compiled HTML, so after DOM augmentation etc

Is there anything comparable to Fiddler for macOS? I heard you can run it in VM but that's just too much brute force for me.

Re: Ask HN: Why does 'View Source' issue a new HTTP request?

#12
post #9
post #6

Earlier quoted context omitted.

Often the dom has been changed, and you want to know what the server actually sent

You can still do that with the inspect menu; if you look at the network history in Chrome, you can see the headers sent, the headers received and the body sent / received.

> You can still do that with the inspect menu; if you look at the network history in Chrome, you can see the headers sent, the headers received and the body sent / received.

That only works if you have it open before the page loaded. It doesn't save information about network requests that occurred before the inspector was opened.

Re: Ask HN: Why does 'View Source' issue a new HTTP request?

#13

It's a bug: https://bugzilla.mozilla.org/show_bug.cgi?id=307089 Or, it's a memory saving feature. To implement "View source from cache" requires keeping around the raw page HTML, which you might not otherwise need after parsing - except you probably will for all the developer tools to work, so this probably should just be considered bug.

How much memory is saved here? http://www.httparchive.org/interesting.php?a=All&l=Dec%202%2... 52 _kilobytes_ ? Really?

Re: Ask HN: Why does 'View Source' issue a new HTTP request?

#14
post #8
post #5

I think it may just be because in both cases it opens in a new tab with the view-source modifier, it treats it like you just opened a copy of the page in a new tab? I believe if you open the inspector instead it does not issue a new request.

> I think it may just be because in both cases it opens in a new tab with the view-source modifier, it treats it like you just opened a copy of the page in a new tab? Interesting. I never payed attention to the resource prefix. Are those standardized at all? Both Firefox and Chrome use the same "view-source:" prefix. > I believe if you open the inspector instead it does not issue a new request. The inspector shows th…

It's not the prefix/scheme that's important, it's the fact that it's a new tab.

Re: Ask HN: Why does 'View Source' issue a new HTTP request?

#18
post #2

I usually have Fiddler running constantly in the background. If a page is slow to load and I want to see the HTML, I would find the actual HTTP request in fiddler and grab the HTML that way. Alternatively, the element inspector doesn't re-issue the request, but it will show the compiled HTML, so after DOM augmentation etc

Is there anything comparable to Fiddler for macOS? I heard you can run it in VM but that's just too much brute force for me.

From what I can tell the Telerik version is on mac also

Re: Ask HN: Why does 'View Source' issue a new HTTP request?

#19
post #2

I usually have Fiddler running constantly in the background. If a page is slow to load and I want to see the HTML, I would find the actual HTTP request in fiddler and grab the HTML that way. Alternatively, the element inspector doesn't re-issue the request, but it will show the compiled HTML, so after DOM augmentation etc

Is there anything comparable to Fiddler for macOS? I heard you can run it in VM but that's just too much brute force for me.

Fiddler is available for MacOS.
Post reply on HN