Caching in the temporary directory is inherently insecure. Other users can view and possibly modify your cache, presenting a big potential security hole. This is particularly an issue if you're using shared hosting where other sites will have the same access to your files that you do, which is already a well-known issue with PHP session security on shared hosting.
If you use shared hosting--or any environment where security from other users is a potential issue--I would advise you to err on the side of caution and not use this part of the script.
Now we're getting somewhere. But we can do even better than this.