/ Updated 8 April 2023 / 1 min read

Prevent PDF Caching With Invoice Ninja 5 (Apache, .htaccess)

If you find that PDF files aren’t updating after changes, it could be that they are cached by the browser or a CDN such as Cloudflare.

If you are running on Apache then you can modify the mod_headers block in the /public/.htaccess file to prevent PDF file caching:


    # Blocks Search Engine Indexing
    Header set X-Robots-Tag "noindex, nofollow"

    # Prevents PDF File Caching
    
        Header set Cache-Control no-store