I typically minify my .css file because it's something I am used to when developing websites, but I have seen some people actually minify their .xml files (such as the .ncx, .opf, etc.). I have always wondered if anyone has seen a noticeable difference when viewing a minified .epub file on a device?

  • 1
    Please pardon my ignorance, what does it means to "minify"?
    – Sekhemty
    Mar 7 '14 at 17:29
  • 3
    @Sekhemty minifying CSS (or HTML) normally involves making something as small as possible, by e.g. removing superfluous whitespace, unnecessary punctuation etc. Without changing the meaning of the text for a program (but making it more difficult to read for humans). In javascript this often involves shortening of variablenames as well.
    – Anthon
    Mar 7 '14 at 17:35
  • @gramps I added a link to explain Minify, If you feel it is unneeded, I will not be offended if you remove it. Mar 7 '14 at 20:44
  • After reading the Wikipedia article and searching around, I don't see any reason to minify epub. The two main reasons are to make long code run quicker not always a help or to speed download time, neither of which is a big concern with an ebook. Mar 7 '14 at 20:58

Personally, I never minify code in ebooks. A big part of the reason for that is that unlike many here, I don't use Sigil or Calibre to edit my epub files—I use either Notepad++ or Geany depending on the OS I'm working in. Because I'm always working with the code, it does nothing but make my life harder if I've minified the whole thing and the client comes back to us with two or three rounds of proofing corrections.

On top of that, many in the publishing world are starting to talk about using HTML5 as a base format for all their books. Since epub 3.0 content files are HTML 5, you're pretty much working directly with the source files when you're working with the epub, and the source files should be human-readable so that any problems that come up with them can be easily fixed.

Finally, the point of minifying code is to let files transfer across networks more quickly, which is a non-issue for ebooks where everything is local.

  • Sometimes minification is used to obfuscate the code, making modifications difficult. Nov 9 '15 at 18:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.