问题
I have a WordPress custom page that has the following image coded in it (CSS in another file applied to a class of this image, just shortening the story here):
<img src='wp-content/themes/MyTheme/images/someimage.png' style='display: none;' />
Once I upload everything on the server it all works fine. However, after a while I can see that the source of that image changed to something like this:
<img src="data:image/png;base64,iVBORw0KGgo...uQmCC" style="display: none;">
This is a huge problem as (long story short) I need to have that image loaded on the page not as a data URI scheme but a regular source link so it is correctly displayed if certain events on the page happen (it works fine before the src is changed and it doesn't after).
Since data URI scheme is new to me how can I prevent it from happening and have the regular source link always displayed? (mind you, at this point I'm not sure whether the WordPress is responsible for it or the server itself)
Any tips would be greatly appreciated, thanks!
回答1:
It's possible that you have PageSpeed modules enabled that are doing this on your website. Had similar issues before.
You can enable and disable modules by using an htaccess file at the root of the website using flag to set your preferences. This page explains how: https://developers.google.com/speed/pagespeed/module/filters
来源:https://stackoverflow.com/questions/19623011/wordpress-avoid-using-data-uri-scheme