A system and method for virtually eliminating a potential security risk
inherent with the caching of network content. Random subdirectory names
are generated for cache directories, while continuing to generate
user-friendly file names. Security is achieved since malicious sites
cannot guess the cache location, which if guessed along with the
filename, could cause a user connected to the site to inadvertently
execute malicious content downloaded by the site to the cache. In
addition to generating random subdirectory names, the system and method
provide enhanced performance by balancing the number of files among the
cache directories, and by limiting the number of files in any cache
directory by creating additional cache directories as needed.