Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Unified Diff: lib/src/codegen/html_codegen.dart

Issue 1131933003: Load time improvements (fixes #140) (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/runtime/messages_widget.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/codegen/html_codegen.dart
diff --git a/lib/src/codegen/html_codegen.dart b/lib/src/codegen/html_codegen.dart
index f8641c0d6383eeb2824bbe43ea6cee3238c29957..b70f79e64c461f87e54c581662ecd268de4d6b82 100644
--- a/lib/src/codegen/html_codegen.dart
+++ b/lib/src/codegen/html_codegen.dart
@@ -53,10 +53,10 @@ String generateEntryHtml(HtmlSourceNode root, CompilerOptions options) {
var fragment = new DocumentFragment();
for (var resource in resources) {
var resourcePath = resourceOutputPath(resource.uri, root.uri);
+ var ext = path.extension(resourcePath);
if (resource.cachingHash != null) {
resourcePath = _addHash(resourcePath, resource.cachingHash);
}
- var ext = path.extension(resourcePath);
if (ext == '.css') {
fragment.nodes.add(_cssInclude(resourcePath));
} else if (ext == '.js') {
@@ -98,7 +98,8 @@ Node _invokeMain(String mainLibraryName) {
/// reverse of what the server does to determine whether a request needs to have
/// cache headers added to it.
_addHash(String outPath, String hash) {
- return path.join('cached', hash, outPath);
+ // (the ____ prefix makes it look better in the web inspector)
+ return '$outPath?____cached=$hash';
}
final _log = new Logger('dev_compiler.src.codegen.html_codegen');
« no previous file with comments | « lib/runtime/messages_widget.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698