img src is making pdf generation too slow with codeigniter

Viewed 538

I am using mpdf library for pdf generation with codeigniter.

I have a png file that is given to generate a logo image in pdf. The generation is too slow. I need to speed up the pdf generation. Does anybody know how to solve this issue?

<div id="mws-logo-wrap">
  <img src="<?php echo base_url();?>images/mws-logo.png" alt="mws admin">
</div>
1 Answers

You are prepending the site URL with the base_url() helper which causes an entire additional HTTP request via the "outside" web.

Try to use a "local" path to the file to prevent additional DNS lookups and HTTP requests.

Related