Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Commit 55e0962

Browse files
committed
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
1 parent 5a51f25 commit 55e0962

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

net/instaweb/rewriter/css_combine_filter.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,12 @@ RewriteContext* CssCombineFilter::MakeRewriteContext() {
533533
}
534534

535535
void CssCombineFilter::DetermineEnabled(GoogleString* disabled_reason) {
536-
set_is_enabled(!driver()->flushed_cached_html());
536+
if (driver()->options()->css_preserve_urls()) {
537+
*disabled_reason = "Due to CSS URL preservation being on.";
538+
set_is_enabled(false);
539+
} else {
540+
set_is_enabled(!driver()->flushed_cached_html());
541+
}
537542
}
538543

539544
} // namespace net_instaweb

pagespeed/system/system_test.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,22 @@ if [ "$SECONDARY_HOSTNAME" != "" ]; then
597597
'.blue{foreground-color:blue}body{background:url(xarrow.png.pagespeed.' \
598598
'<style>.yellow{background-color:#ff0}</style>'
599599

600+
# Make sure that optimize for bandwidth + CombineCSS doesn't eat
601+
# URLs.
602+
URL=http://optimizeforbandwidth.example.com/mod_pagespeed_example
603+
URL=$URL/combine_css.html?PageSpeedFilters=+combine_css
604+
OUT=$(http_proxy=$SECONDARY_HOSTNAME \
605+
$WGET -q -O - --header=X-PSA-Blocking-Rewrite:psatest $URL)
606+
check_from "$OUT" fgrep -q bold.css
607+
608+
# Same for CombineJS --- which never actually did, to best of my knowledge,
609+
# but better check just in case.
610+
URL=http://optimizeforbandwidth.example.com/mod_pagespeed_example
611+
URL=$URL/combine_javascript.html?PageSpeedFilters=+combine_javascript
612+
OUT=$(http_proxy=$SECONDARY_HOSTNAME \
613+
$WGET -q -O - --header=X-PSA-Blocking-Rewrite:psatest $URL)
614+
check_from "$OUT" fgrep -q combine_javascript2
615+
600616
# Test that we work fine with an explicitly configured SHM metadata cache.
601617
start_test Using SHM metadata cache
602618
HOST_NAME="http://shmcache.example.com"

0 commit comments

Comments
 (0)