[cache_info]

Description

Link: [cache_info]
Author: Jason Huck
Category: Utility
Version: 8.5.x
License: Public Domain
Posted: Apr. 08, 2008
Updated: Jan. 01, 0001
More by this author...

This tag returns a map of information about the specified cache, including its id, type, content, and last refresh date. Returns null if the specified cache is not found. The map elements are: content, stat_fetch, type, id, stat_store, and date. Useful if you need to know when a cache was created, vs. when it will expire.

Parameters

none


Sample Usage

cache_info('mycache')->find('date');

-> 2008-04-08 14:12:44
						

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
define_tag(
	'info',
	-namespace='cache_',
	-req='name', -copy,
	-priority='replace',
	-description='Returns information about the specified cache.'
);
	// map elements: content, stat_fetch, type, id, stat_store, date

	// add the server name to the cache name if host-specific caches is enabled
	cache_preferences->find('_cache_host') == 'Y' ? #name += '|' + server_name;

	// return null if there are no caches or the specified cache does not exist		
	!global_defined('_Cache_Storage') || $_Cache_Storage->find(#name) == '' ? return;
	
	// return a reference to the specified cache
	return(@$_Cache_Storage->find(#name));		
/define_tag;

 

Related Tags



Comments

none

Email:


Password:



Newest

Most Popular