Wrong PDF file of invoice draft on preview/send preview

Hi there,

I have problem with PDFs generated from invoice drafts. When I have zero of invoice drafts for client A, after making of new invoice draft for client A, it is properly showed in PDF preview. When I have already one or more invoice drafts, after making another one for client A, it shows me some other invoice draft I made earlier. Sometimes months ago, sometimes yesterday. Sadly I can’t remove these drafts for now.

It seems like PDF files for every invoice draft are not distinct of each other. I couldn’t reproduce this issue on Invoice Ninja demo, sadly.

Any idea?


Are you using the latest available v5 version?

@david any thoughts?

Oh yeah, I forgot. At the time of writing this topic, it was v5.3.55 but I just updated Invoice Ninja and tested it again. Sadly, nothing changed.

@hillel @david

This looks like the same issue as

@hahyes @xoo

are you running your servers behind cloudflare? it may be a caching issue?

@xoo There is difference, PDF preview is showing me wrong invoice too.

@david No, we don’t use Cloudflare. It is on shared hosting tho, so I don’t know what are they doing on their side. Maybe they are using some caching for websites on their hosting, but I really doubt it. As I said, problem occurs only in range of the same client if there are any invoice drafts created for this client already.

@david Not using Cloudflare (or anything else), it’s all direct access.

It seems like my problem got solved using troubleshooting tutorial and by removing all data from the catalog and copying clean release from Github. Added Cache-Control header to .htaccess with value no-store. I’m setting this post as answer.

Source of troubleshooting, first point: Free Source Available Invoicing, Expenses & Time-Tracking | Invoice Ninja