PHP/FPDF keep loading behind cloudflare

php
#1

Hi, i have a problem with cloudflare.
My web app uses FPDF (PHP) to generate PDF files, but when i activate clouflare the PDF generates only once, when i reload the pdf it does not load anymore.

The solution i found now is to disable cloudflare and use it as “DNS Only” mode, but i want to use cloudflare in my site, any idea why is tis happening?

0 Likes

#2

PDF is normally a static file that doesn’t change (if you’re using the same filename).
Use a Page Rule to bypass caching for PDF files:

Match: example.com/*.pdf (this should match all paths that have a file that ends with pdf)
Set: Cache Level (Bypass)

1 Like

#3

Hi, the PDF is generated by PHP code, The url is like example.com/?f=generate_pdf, i have tried to set Cache Level to Bypass to all the site but problem sill there.

0 Likes

closed #4

This topic was automatically closed after 30 days. New replies are no longer allowed.

0 Likes