Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Apache: Cache Item for Random Period

Posted on 2013-06-25
3
Medium Priority
?
199 Views
Last Modified: 2013-07-09
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

0
Comment
Question by:hankknight
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39275348
Just use rand in the header
rand(604800, 1209600);
0
 
LVL 16

Author Comment

by:hankknight
ID: 39281393
rand is a PHP function.  I need to do this with Apache in the .htaccess file.
0
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 39282051
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.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month10 days, 3 hours left to enroll

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question