Below is a Checkbox SVG that I have added to my tables;
.check-nobase64 {
background-image: url("data:image/svg+xml,%3Csvg width='42' height='42' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M-.001 21c0-11.598 9.402-21 21-21s21 9.402 21 21-9.402 21-21 21-21-9.402-21-21zM19.8 29.99l12.092-15.115-2.186-1.75L19.398 26.01l-7.303-6.086-1.792 2.151L19.8 29.99z' fill='%231675BB'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-size: cover;
width: 28px;
height: 28px;
margin: 0 auto;
}
<div class="check-nobase64"></div>
Enabling Cloudflare caching automatically converts it to base64 and breaks the SVG code;
.check-base64 {
background-image: url(data:image/svg+xml;base64,PHN2Z1wgd2lkdGg9XCc0MlwnXCBoZWlnaHQ9XCc0MlwnXCBmaWxsPVwnbm9uZVwnXCB4bWxucz1cJ2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnXCc+PHBhdGhcIGZpbGwtcnVsZT1cJ2V2ZW5vZGRcJ1wgY2xpcC1ydWxlPVwnZXZlbm9kZFwnXCBkPVwnTS0uMDAxXCAyMWMwLTExLjU5OFwgOS40MDItMjFcIDIxLTIxczIxXCA5LjQwMlwgMjFcIDIxLTkuNDAyXCAyMS0yMVwgMjEtMjEtOS40MDItMjEtMjF6TTE5LjhcIDI5Ljk5bDEyLjA5Mi0xNS4xMTUtMi4xODYtMS43NUwxOS4zOThcIDI2LjAxbC03LjMwMy02LjA4Ni0xLjc5MlwgMi4xNTFMMTkuOFwgMjkuOTl6XCdcIGZpbGw9XCcjMTY3NUJCXCcvPjwvc3ZnPg==);
background-repeat: no-repeat;
background-size: cover;
width: 28px;
height: 28px;
margin: 0 auto;
}
<div class="check-base64">
Decoding the base64 encoding reveals the original SVG data as seen below;
%3Csvg width='42' height='42' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M-.001 21c0-11.598 9.402-21 21-21s21 9.402 21 21-9.402 21-21 21-21-9.402-21-21zM19.8 29.99l12.092-15.115-2.186-1.75L19.398 26.01l-7.303-6.086-1.792 2.151L19.8 29.99z' fill='%231675BB'/%3E%3C/svg%3E"
This information shows that when Cloudflare converts the SVG to base64, the URL Encoding section gets distorted. Any suggestions on resolving this issue would be greatly appreciated.
Edit: The main problem seems to be the #
symbol in the fill part of the SVG. Manually converting #
to %23
allows the decoded base64 to display correctly.