# PDF Caching Help - JW Total CMS

**URL:** <https://forums.realmacsoftware.com/t/pdf-caching-help-jw-total-cms/15465>\
**Category:** RapidWeaver Classic\
**Created:** [July 28, 2017, 6:19pm UTC](https://forums.realmacsoftware.com/t/pdf-caching-help-jw-total-cms/15465 "2017-07-28T18:19:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![danhmill](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/danhmill/32/16705_2.png) [@danhmill](https://forums.realmacsoftware.com/u/danhmill)\
**Post date:** [July 28, 2017, 6:19pm UTC](https://forums.realmacsoftware.com/t/pdf-caching-help-jw-total-cms/15465/1 "2017-07-28T18:19:07Z")

</div>

Any help appreciated. I’ve tried to find a solution and have only run across suggestions involving .htaccess files and some other things that I wish to avoid. I’m using Joe Workman’s awesome Total CMS for a site. I have a link (the class schedule link in the website below) that is fed by Total CMS’s “File” element. Whenever a file is uploaded to populate this link it has the same file name. As a result “old” PDF files are getting cached and the newly uploaded PDF’s are not displaying (sans a user refresh of their browser).

Any thoughts on how I could either stop the caching of this one particular link/file and/or automatically append the file name on upload so that the file name is different (thus avoiding the cache issue). I feel like I’m missing a simple solution here 😕

[http://1southriding.gotopkick.com](http://1southriding.gotopkick.com)

---

<div class="post-metadata">

**Author:** ![danhmill](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/danhmill/32/16705_2.png) [@danhmill](https://forums.realmacsoftware.com/u/danhmill)\
**Post date:** [August 2, 2017, 5:41pm UTC](https://forums.realmacsoftware.com/t/pdf-caching-help-jw-total-cms/15465/2 "2017-08-02T17:41:35Z")

</div>

Thanks for the reads everyone. Though I was hoping to find a way within Total CMS and/or Rapidweaver I went ahead and dove into the .htaccess file route based on something I found on a PHP forum (link below for credit where credit is due). It was very straight forward and seems to have resolved the caching issue. Further…the site has not exploded yet 🙂

> **[pdf cache problem- old pdf served not new one](https://forums.phpfreaks.com/topic/280736-pdf-cache-problem-old-pdf-served-not-new-one/)**
>
> I have a website where I allow people to submit a .pdf file and it is then displayed in an iframe or in a pdf object in a div. The names of the files always stay the same, and are uploaded to a specific folder. Problem is- when they upload a new .pdf...

Here is the code I discovered at the link above. Hope this helps someone in some way.

/\</ FilesMatch “.(pdf)$”\>  
FileETag None  
  
Header unset ETag  
Header set Cache-Control “max-age=0, no-cache, no-store, must-revalidate”  
Header set Pragma “no-cache”  
Header set Expires “Wed, 11 Jan 1984 05:00:00 GMT”  
  
\</FilesMatch /\>/
