This post isn’t about viz caching, but rather about disabling the caching in the browser and in Apache so that you can see your changes as you modify CSS or other files when customizing vizqlserver and vizportal.
Browser cache is always an issue when trying to see the latest version. The best method for rapid testing I’ve found is Google Chrome’s Developer Tools. Under the Network tab, there is a wonderful “Disable cache” check box. Regardless of what tab you are looking at, once this check box is clicked, as long as the Developer Tools toolbar is up (no matter how minimized), every page refresh will get a new version from the web server.
That’s not enough though, because Tableau Server also has caching on at the Apache web server level. All of this is controlled in the standard httpd.conf file, which is located at:
Even better, this change persists through Tableau Server installations the best I can tell.
Go through the .conf file and find anywhere with ‘ExpiresDefault’ set to “access plus 1 year” and change it to “access plus 2 seconds”. Then restart Tableau Server. Now Apache won’t be serving up a cached version to the browser after 2 seconds.
Later you can change it to a longer time period, although I don’t know that 1 year is ever necessary.
Update: Recently, one of the excellent support engineers at Tableau let me in on this tip:
“The httpd.conf gets updated whenever configuration is saved or tabadmin config is ran. You would need to update the template if you want it to persist.
Tableau Server\10.0\templates\httpd.conf.templ (primary or single-node)
Tableau Server\worker\templates\httpd.conf.templ (worker)”
So if you want persistent changes, you’ll need to update the template (and that of course will be overwritten when you make your next upgrade. Such is the life of hacks).
One last hurdle to making changes is that there are .gz versions of each HTML/CSS/JS file which the Apache server is configured to be used if they exist instead of the real file. If you want to test a change, you need to remove the .gz file somehow (the easiest way is to add ‘.original’ to the end of the file after .gz) so that the .html/.css file is being used. You can save your edited HTML/CSS file later to a .gz so it is served up even more quickly.