return;
}
ResourceRecord resourceFinishEvent = eventRecord.cast();
NetworkResource savedNetworkResource =
HintletNetworkResources.getInstance().getResourceData(resourceFinishEvent.getRequestId());
if (savedNetworkResource == null) {
return;
}
// Don't suggest compressing very small components.
int size = savedNetworkResource.getDataLength();
if (size < SIZE_THRESHOLD) {
return;
}
if(!HintletCacheUtils.isCompressibleResourceType(WebInspectorType.getResourceType(savedNetworkResource))){
return;
}
//add hint if not compressed
if (!HintletHeaderUtils.isCompressed(savedNetworkResource.getResponseHeaders())) {
addHint(getHintletName(), savedNetworkResource.getResponseReceivedTime(), "URL " + savedNetworkResource.getUrl()
+ " was not compressed with gzip or bzip2", resourceFinishEvent.getSequence(),
HintRecord.SEVERITY_INFO);
}
}