Skip to content

Commit

Permalink
* A small optimization in the CSS cache code that saves a dozen bytes…
Browse files Browse the repository at this point in the history
… on default gzipped CSS files. (Subs-Cache.php)

* For a few less bytes... (common.css, index.css)

- Removed a @ suppressor that I think wasn't useful. If the cache code fails, it should show up as an error so that it can be fixed. (Subs-Cache.php)
  • Loading branch information
Nao committed Mar 3, 2017
1 parent 1d5d214 commit 168f199
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions core/app/Subs-Cache.php
Expand Up @@ -690,9 +690,10 @@ function wedge_cache_css_files($folder, $ids, $latest_date, $css, $gzip = false,
$final = preg_replace('~//[ \t][^\n]*~', '', $final); // Strip remaining comments like me. OMG does this mean I'm gonn

// Just like comments, we're going to preserve content tags.
preg_match_all('~(?<=\s)content\h*:\h*(.*?)[\h;]*(?=[}\v])~', $final, $contags);
$final = preg_replace('~(?<=\s)content\h*:\h*~', 'content:', $final);
preg_match_all('~(?<=\s)content:(.*?)[\h;]*(?=[}\v])~', $final, $contags);
$context['reset_content_counter'] = true;
$final = preg_replace_callback('~(?<=\s)content\h*:\h*.*?[\h;]*(?=[}\v])~', 'wedge_hide_content', $final);
$final = preg_replace_callback('~(?<=\s)content:.*?[\h;]*(?=[}\v])~', 'wedge_hide_content', $final);

foreach ($plugins as $plugin)
$plugin->process($final);
Expand Down Expand Up @@ -803,7 +804,7 @@ function wedge_hide_content()
$i = 0;
unset($context['reset_content_counter']);
}
return 'content: wedge' . $i++;
return 'content:wedge' . $i++;
}

function wedge_replace_theme_vars($match)
Expand Down Expand Up @@ -1951,7 +1952,7 @@ function cache_get_data($orig_key, $ttl = 120, $put_callback = null)
// Otherwise it's the file cache!
elseif (file_exists(CACHE_DIR . '/keys/' . $key . '.php') && @filesize(CACHE_DIR . '/keys/' . $key . '.php') > 10)
{
@include(CACHE_DIR . '/keys/' . $key . '.php');
include(CACHE_DIR . '/keys/' . $key . '.php');
if (empty($valid))
@unlink(CACHE_DIR . '/keys/' . $key . '.php');
}
Expand Down
2 changes: 1 addition & 1 deletion core/skins/common.css
Expand Up @@ -88,7 +88,7 @@
@if $can_animate
width, height: 11px
border-radius: 100%
border: 1px solid rgba(0,0,0,0.5)
border: 1px solid rgba(0,0,0,.5)
border-top-color: transparent
box-shadow: 1px 1px 7px #777
animation: spin 1s infinite linear
Expand Down
4 changes: 2 additions & 2 deletions core/skins/index.css
Expand Up @@ -1504,15 +1504,15 @@ section.block extends .wrc
@if $sub_radius
border-radius: $sub_radius $sub_radius 0 0
@endif
margin: -0.9em -1.2em 1em
margin: -.9em -1.2em 1em
a
text-decoration: underline
footer extends .wefoot
padding: 3px 12px
@if $sub_radius
border-radius: 0 0 $sub_radius $sub_radius
@endif
margin: .5em -1.2em -0.9em
margin: .5em -1.2em -.9em
dl.settings
margin: 0

Expand Down

0 comments on commit 168f199

Please sign in to comment.