Permalink
Browse files

Quickfix for URL preservation + combine_css conflict:

for now disable combine_css. Proper resolution (which will
make it win in some circumstances) will be a follow up,
but likely quite a bit more complex.
Note that combine_js isn't affected by this since it makes an entirely
new script element for combination (as well as new ones for evals), rather
than using the one from the first input.

Addresses Otto's reduction in issue #1215
  • Loading branch information...
morlovich committed Dec 17, 2015
1 parent 5a51f25 commit 55e0962b1fa0eb8ff67028a0f1d616b164dc28f0
Showing with 22 additions and 1 deletion.
  1. +6 −1 net/instaweb/rewriter/css_combine_filter.cc
  2. +16 −0 pagespeed/system/system_test.sh
@@ -533,7 +533,12 @@ RewriteContext* CssCombineFilter::MakeRewriteContext() {
}

void CssCombineFilter::DetermineEnabled(GoogleString* disabled_reason) {
set_is_enabled(!driver()->flushed_cached_html());
if (driver()->options()->css_preserve_urls()) {
*disabled_reason = "Due to CSS URL preservation being on.";
set_is_enabled(false);
} else {
set_is_enabled(!driver()->flushed_cached_html());
}
}

} // namespace net_instaweb
@@ -597,6 +597,22 @@ if [ "$SECONDARY_HOSTNAME" != "" ]; then
'.blue{foreground-color:blue}body{background:url(xarrow.png.pagespeed.' \
'<style>.yellow{background-color:#ff0}</style>'

# Make sure that optimize for bandwidth + CombineCSS doesn't eat
# URLs.
URL=http://optimizeforbandwidth.example.com/mod_pagespeed_example
URL=$URL/combine_css.html?PageSpeedFilters=+combine_css
OUT=$(http_proxy=$SECONDARY_HOSTNAME \
$WGET -q -O - --header=X-PSA-Blocking-Rewrite:psatest $URL)
check_from "$OUT" fgrep -q bold.css

# Same for CombineJS --- which never actually did, to best of my knowledge,
# but better check just in case.
URL=http://optimizeforbandwidth.example.com/mod_pagespeed_example
URL=$URL/combine_javascript.html?PageSpeedFilters=+combine_javascript
OUT=$(http_proxy=$SECONDARY_HOSTNAME \
$WGET -q -O - --header=X-PSA-Blocking-Rewrite:psatest $URL)
check_from "$OUT" fgrep -q combine_javascript2

# Test that we work fine with an explicitly configured SHM metadata cache.
start_test Using SHM metadata cache
HOST_NAME="http://shmcache.example.com"

0 comments on commit 55e0962

Please sign in to comment.