title_body: How can I optimize an epub file? How can I optimize an epub file, in order, but not limited to:
  
  
  limit the chances of compatibility issues?
  make it faster to load and to be processed from the reader?
  keep its look consistent throughout different devices and readers?
upvoted_answer: Limiting compatibility issues
  
  
  Perform a validation of the file structure. See this question about this subject.
  
  
  Making it faster to load
  
  
  Keep the size of individual internal HTML files small. The reader usually load them individually when needed, and it is (obviously) faster to load a small file than a big one; as a rule of thumb the size limit is considered to be 250~300 KB. It is better to have many smaller files than a single heavy one, so try to have any file cover a single chapter or section rather than the whole book.
  Always to keep the individual files smaller and to reduce required processing power, use a distinct stylesheet to define the CSS styles, rather than putting them inside each individual HTML text file.
  Try to keep the HTML code of you files as simple and tidy as possible. I.E. use &lt;i&gt; and &lt;b&gt; tags for italic and bold text instead of their relative &lt;span style="font-style:italic"&gt; and &lt;span style="font-weight:bold"&gt;.
  If you are including images, keep their size as small as possible. Consider the screen resolutions of the devices where the book will be read, whether they have color or B/W displays, and if the images are photographies or other complex illustrations, or instead simple drawings or diagrams.
  
  
  Keeping it consistent
  
  
  Keep the visual look as simple as possible; if you want to include some fancy layout (i.e. for chapter titles or other particular portions of text like quotes and so on) try to define it as properly and accurately as possible with CSS styles, and test the outcome with the greater number of reading devices and software that you can.
  If you want to use any specific font, be sure to include it in the epub file and to define its @font-face and styles in the CSS file.