However, as the content of the image changes, would it not be much more logical to change the filename, rather than adding a dummy parameter?
Security wise it would also stop anyone from "stealing" images to which he should have no access, by simply directly requesting $image_web_path.'imagefile6.gif over and over again.Using a module such as Data::UUID can give you a unique identifier everytime you ask for one. If you clean the server-side "cache" of your files on a regular basis, it becomes almost impossible to guess the file name of any of the files in the cache, thus protecting the contents of these graphic files. The actual odds of guessing right would be 1 / (2^128) times the number of files (or better than 1 in 30 million300 billion billion billion billion times the number of files) in your cache.
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
In reply to Re^2: Web server cache-ing?
by CountZero
in thread Web server cache-ing?
by campbell
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |