Apache: Cache Item for Random Period

Using Apache, is there any way to randomize the length of time that an item is cached?  I would like an item to be cached for a random period between 604800 seconds and 1209600 seconds.
Header set Cache-Control "public, max-age=" (random number between 604800 and 1209600)

Open in new window

LVL 16
Who is Participating?
GaryConnect With a Mentor Commented:
Ok, sorry. It's not directly possible, one possibility is http://httpd.apache.org/docs/current/rewrite/rewritemap.html#prg
But this is beyond my knowing, request attention to add perl to the topics - if it's something your interested in.
Just use rand in the header
rand(604800, 1209600);
hankknightAuthor Commented:
rand is a PHP function.  I need to do this with Apache in the .htaccess file.
All Courses

From novice to tech pro — start learning today.