Skip to content

Commit

Permalink
Only create fallback files for CSS & JS (and not for images, as per h…
Browse files Browse the repository at this point in the history
  • Loading branch information
futtta committed May 25, 2020
1 parent 96de422 commit 750d2fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classes/autoptimizeCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function cache( $data, $mime )
if ( self::do_fallback() && strpos( $this->filename, '_snippet_' ) === false && strpos( $this->filename, '_single_' ) === false ) {
$_extension = pathinfo( $this->filename, PATHINFO_EXTENSION );
$_fallback_file = AUTOPTIMIZE_CACHEFILE_PREFIX . 'fallback.' . $_extension;
if ( ! file_exists( $this->cachedir . $_extension . '/' . $_fallback_file ) ) {
if ( ( 'css' === $_extension || 'js' === $_extension ) && ! file_exists( $this->cachedir . $_extension . '/' . $_fallback_file ) ) {
file_put_contents( $this->cachedir . $_extension . '/' . $_fallback_file, $data );
}
}
Expand Down

0 comments on commit 750d2fc

Please sign in to comment.