Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Commit

Permalink
Quickfix for URL preservation + combine_css conflict:
Browse files Browse the repository at this point in the history
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 55e0962
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
7 changes: 6 additions & 1 deletion net/instaweb/rewriter/css_combine_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 16 additions & 0 deletions pagespeed/system/system_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 55e0962

Please sign in to comment.