Cleaned up cache directory configuration.
URL-encode IDs in filenames to reduce the chances of illegal filenames and for consistency with Solr data source.