How can I convert fonts and images (assets in general) to data attributes?
Would assets load faster or slower this way?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should be aware that DataURI’s are not supported by IE earlier than IE8. Also, IE8 has a limitation for at most 32KB of dataURI’s in css assets. A more detailed description about DataURI’s can be found at this blog post.
If you need the java implementation, you can find one here:
This allow you to transform all images into a base64 encoded uri in css files. For more details about how to integrate this implementation into your project, visit this page:
Disclosure: I’m affiliated to wro4j project.