Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Manual Cache File Naming

August 4, 2000

I used a template to generate cache files on the fly, and this was based on dates and times. The cache's filename is generated on the value's being passed, but some filesystems do not allow colons that would be found in a time format. I realized I needed to allow the developer to name the cache file manually if desired.

<my-style name="time now" time="12:32:00" cache_name="onTheAir">

Originally, this tag would have produced a cache file with a name such as, 'style_name=time now_time=12:32:00'. Now, this module would produce a cache file with the simpler (valid) name: 'style_onTheAir'

'On The Hour' Cache Updating

JP's system allowed the developer to set the expires delay for a cache file. For example, if the expires delay was set to 3600 seconds, the cache file would be regenerated subsequent to the next hit after 3600 seconds have elapsed since the creation of the cache file.

My site needed to work a little differently. I needed the ability to automatically have the module refresh at specific intervals, such as, on the hour, or on the quarter-hour, or on the half-hour, etc. So I went ahead and added some functions to perform these evaluations and return whether the module was due to be updated or not.

<my-style name=test refresh='HALFHOUR'>

(this cache file updates itself every half-hour)

The available arguments for the refresh variable are:
MINUTE, QUARTERHOUR, HALFHOUR, HOUR, HALFDAY, DAY, MONTH

Another Look At "Building Your Website With Cached Dynamic Modules"
Another Look At "Building Your Website With Cached Dynamic Modules"
Cache File Locking


Up to => Home / Authoring / Languages / PHP / Dynamic_Modules2




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers