Bug 16395 - Inspector needs to use cached resources
Summary: Inspector needs to use cached resources
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Minor
Assignee: Andrey Kosyakov
URL: http://gcep.stanford.edu/
Keywords:
: 47982 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-12-10 23:09 PST by Gavin Sherlock
Modified: 2010-10-26 08:08 PDT (History)
6 users (show)

See Also:


Attachments
patch (12.62 KB, patch)
2010-10-20 07:14 PDT, Andrey Kosyakov
no flags Details | Formatted Diff | Diff
patch (12.14 KB, patch)
2010-10-21 01:48 PDT, Andrey Kosyakov
yurys: review+
Details | Formatted Diff | Diff
patch to land (13.71 KB, patch)
2010-10-26 05:50 PDT, Andrey Kosyakov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gavin Sherlock 2007-12-10 23:09:00 PST
Go to:

http://gcep.stanford.edu/

Inspect the page.  Note the image generated by:

http://cgi.stanford.edu/group/gcep/cgi-bin/random_image.cgi?path=images/home/rotating

The version showing on the page will be different than the image show in the web inspector - thus, the web inspector must re-interrogate that url instead of using the already rendered image.
Comment 1 Timothy Hatcher 2007-12-20 16:33:20 PST
Yep, we need to sue the cached version and not re-fetch the image.
Comment 2 Alexander Pavlov (apavlov) 2010-10-20 06:30:09 PDT
*** Bug 47982 has been marked as a duplicate of this bug. ***
Comment 3 Andrey Kosyakov 2010-10-20 07:14:44 PDT
Created attachment 71291 [details]
patch

- Added base64Encoded parameter to resourceContent() in Inspector.idl
- Cache resource content in resource.getContent()
- Report whether content is encoded along with content in callback
- Handle resource.getContent() properly if content is not yet available
- Use data: url for images if resource content is available
Comment 4 Andrey Kosyakov 2010-10-21 01:48:55 PDT
Created attachment 71405 [details]
patch

- Fixed an attempt to retrieve content before it's available
- Dropped an accidental change to Settings.js
Comment 5 Yury Semikhatsky 2010-10-21 03:07:31 PDT
Comment on attachment 71405 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=71405&action=review

> WebCore/inspector/front-end/Resource.js:621
> +        if (typeof this._contentEncoded !== "undefined")

May be just use a separate flag _contetRequested?

> WebCore/inspector/front-end/Resource.js:635
> +        if (this.frameID) {

style: please remove the brackets
Comment 6 Pavel Feldman 2010-10-21 03:29:20 PDT
Comment on attachment 71405 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=71405&action=review

> WebCore/inspector/front-end/Resource.js:615
> +        return "data:" + this.mimeType + (this._contentEncoded ? ";base64," : ",") + this._content;

Could you please make sure it does not regress performance prior to landing? Opening slashdot / techcrunch and looking at the speed the icons show up with would be a good test.
Comment 7 Andrey Kosyakov 2010-10-26 05:50:49 PDT
Created attachment 71867 [details]
patch to land

- rebased
- picked nits
- put usage of data url in resource tree thumbnails under flag (enabled by default)
Comment 8 Andrey Kosyakov 2010-10-26 05:56:19 PDT
(In reply to comment #6)
> (From update of attachment 71405 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=71405&action=review
> 
> > WebCore/inspector/front-end/Resource.js:615
> > +        return "data:" + this.mimeType + (this._contentEncoded ? ";base64," : ",") + this._content;
> 
> Could you please make sure it does not regress performance prior to landing? Opening slashdot / techcrunch and looking at the speed the icons show up with would be a good test.

There was no visual slow-down on techcrunch (with ~120 images, the average latency was ca. 500ms, 900ms worst; remote debugging mode slower by factor of ~1.3).

As discussed, putting usage of data urls in resource tree thumbnails under a flag (useDataURLForResourceImageIcons).
Comment 9 Andrey Kosyakov 2010-10-26 08:08:08 PDT
Manually committed r70519: http://trac.webkit.org/changeset/70519