Earlier quoted context omitted.
Am I in some parallel universe here ? We are talking about hundreds of KBs of memory total which is nothing and if it's a worry for mobile devices we have the disk. It's not a feature that demands instant performance.
> It's not a feature that demands instant performance. Hence it's acceptable to request the document from the server when opening 'View Source'.
Ask HN: Why does 'View Source' issue a new HTTP request?
51–60 of 97 posts
Re: Ask HN: Why does 'View Source' issue a new HTTP request?
#52Earlier quoted context omitted.
Isn't that one of the issues nowadays, that people have the attitude "we have enough memory" and thus don't tend to care about optimizing for memory usage anymore. Your suggested solution, about discarding when memory is needed, solves this problem. But it solves a problem that would be created by needlessly storing a lot more data than needed. So it's a solution to a problem that was not a problem to begin with. But…
> "we have enough memory" Your phone is in disagreement.
Re: Ask HN: Why does 'View Source' issue a new HTTP request?
#53Earlier quoted context omitted.
Couldn't you reconstruct the source from the internal dom representation anyway?
No. The parser corrects and changes the source to make the DOM. So it is impossible to find errors usually. So things like: the parser will correct, and therefore the DOM will be correct. But what it does to fix this may break your site. I often found the CSS would be screwed up for many reasons (rules don't match DOM structure -- due to bugs all over our codebase)
Re: Ask HN: Why does 'View Source' issue a new HTTP request?
#54I wish View Source were more flexible. I would like: * Raw: a view of the actual body as sent in the response. Although I'm not aware of the current situation, at least some browsers used to subtly alter what was sent, even for View Source (possibly related to validity corrections). I want a guarantee that what I'm viewing is what the server sent. * View source as it is today (with a good common understanding of what…
Re: Ask HN: Why does 'View Source' issue a new HTTP request?
#55I 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?
#56I wish View Source were more flexible. I would like: * Raw: a view of the actual body as sent in the response. Although I'm not aware of the current situation, at least some browsers used to subtly alter what was sent, even for View Source (possibly related to validity corrections). I want a guarantee that what I'm viewing is what the server sent. * View source as it is today (with a good common understanding of what…
Re: Ask HN: Why does 'View Source' issue a new HTTP request?
#57I wish View Source were more flexible. I would like: * Raw: a view of the actual body as sent in the response. Although I'm not aware of the current situation, at least some browsers used to subtly alter what was sent, even for View Source (possibly related to validity corrections). I want a guarantee that what I'm viewing is what the server sent. * View source as it is today (with a good common understanding of what…
You can always use curl. Chrome allows you to copy paste a full curl command (with all the arguments and cookies) to issue an identical http request.
Re: Ask HN: Why does 'View Source' issue a new HTTP request?
#58It'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.
Re: Ask HN: Why does 'View Source' issue a new HTTP request?
#59I wish View Source were more flexible. I would like: * Raw: a view of the actual body as sent in the response. Although I'm not aware of the current situation, at least some browsers used to subtly alter what was sent, even for View Source (possibly related to validity corrections). I want a guarantee that what I'm viewing is what the server sent. * View source as it is today (with a good common understanding of what…
You can always use curl. Chrome allows you to copy paste a full curl command (with all the arguments and cookies) to issue an identical http request.
Re: Ask HN: Why does 'View Source' issue a new HTTP request?
#60Earlier quoted context omitted.
The browser would have to save the source text for EVERY tab it opens, regardless of whether you view source or not. That seems more onerous than making a separate request for the source code every once in a while.
Am I in some parallel universe here ? We are talking about hundreds of KBs of memory total which is nothing and if it's a worry for mobile devices we have the disk. It's not a feature that demands instant performance.