WordPress: avoid using data URI scheme

谁都会走 提交于 2021-01-28 21:12:34

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!