Skip to main content
Help Center
The GoDaddy Community will undergo maintenance starting on Tuesday, August 3rd at 3pm PST / 6pm EST. Learn more
  • GoDaddy Community
  • Building & Managing Client Sites
  • Building & Managing Client Sites

    cancel
    Showing results for 
    Show  only  | Search instead for 
    Did you mean: 
    Go to solution
    Greg_Wees
    New

    PDF Cache - How to Clear for Users?

    Hi, first time here so apologies if I'm in the wrong section. My client has a site with a thousand links (or so) to PDF documents that get updated regularly. The issue is that when the updated docs are published (with the same file name so they don't have to update 1000 links for each product version), users clicking the 'new' link can pull up a previous (cached) version. 

    The obvious solution is to change the file names each time, but that is a massive retroactive change that they will reject on T/C grounds.

    I am aware that clearing the cache from CPanel clears everything EXCEPT PDF documents. I am also told that Adobe creates a kind of cached local version of PDFs accessed from the Web, i.e. there are no server-side solutions (on IIS at least) because the cache info is on the client side. Not positive about this but that's what I've heard. Anyway that's IIS, I am less familiar with Linux as this is my only client on GoDaddy.

     

    Any thoughts on how to re-publish these documents, with the same file name, and force the client to get the updated, latest version of that PDF from the server when the link is clicked? Thanks for any advice...

    1 ACCEPTED SOLUTION
    PL281
    Super User IV

    @Greg_Wees 

     

    I would actually recommend adjusting the .htaccess to force the PDFs to be downloaded vs opened in the browser - this should get around the issue as it's downloading from the server vs loading a cached version...

     

    Forcing a file to be downloaded

    By default, if a text file (.txt) is requested, the contents of the file is shown in the browser and is not downloaded. This is because the default MIME type for .txt files specifies to show the files and not download them. However, you can change this by adding the following line to your .htaccess file:

    AddType application/octet-stream txt
    

    You can change the extension to anything you like such as mp3 or mov. Here is another example which does the same thing – any files ending in mov, mp3, jpg, or pdf are automatically downloaded:

    <FilesMatch "\.(mov|mp3|jpg|pdf)$">
    ForceType application/octet-stream
    Header set Content-Disposition attachment
    </FilesMatch>
    I am a GoDaddy End User - Just Like You
    Check out my site! | I currently manage over 300 WordPress Websites
    * Please note that I offer free advice on this forum. Thank You Info If you would like personalized help, please contact me. Otherwise, please ask your question in the proper forum so the answer can assist EVERYONE in the community and not just you. Thanks! *

    Once your issue is resolved,
    please be sure to come back and click accept for the solution

    Get Better Support on the Community Boards!
    Etiquette When Asking for Help from the Community

    View solution in original post

    1 REPLY 1
    PL281
    Super User IV

    @Greg_Wees 

     

    I would actually recommend adjusting the .htaccess to force the PDFs to be downloaded vs opened in the browser - this should get around the issue as it's downloading from the server vs loading a cached version...

     

    Forcing a file to be downloaded

    By default, if a text file (.txt) is requested, the contents of the file is shown in the browser and is not downloaded. This is because the default MIME type for .txt files specifies to show the files and not download them. However, you can change this by adding the following line to your .htaccess file:

    AddType application/octet-stream txt
    

    You can change the extension to anything you like such as mp3 or mov. Here is another example which does the same thing – any files ending in mov, mp3, jpg, or pdf are automatically downloaded:

    <FilesMatch "\.(mov|mp3|jpg|pdf)$">
    ForceType application/octet-stream
    Header set Content-Disposition attachment
    </FilesMatch>
    I am a GoDaddy End User - Just Like You
    Check out my site! | I currently manage over 300 WordPress Websites
    * Please note that I offer free advice on this forum. Thank You Info If you would like personalized help, please contact me. Otherwise, please ask your question in the proper forum so the answer can assist EVERYONE in the community and not just you. Thanks! *

    Once your issue is resolved,
    please be sure to come back and click accept for the solution

    Get Better Support on the Community Boards!
    Etiquette When Asking for Help from the Community

    View solution in original post