HttpRunTime Cache vs Enterprise Library Cache

This post aims to highlight the differences between the cache implementation of HttpRunTime and EnterpriseLibrary

HttpRuntime.Cache Enterprise Library Caching Block
Standard Actions
Add Item to Cache
Read Item from Cache
Update Item to Cache (using insert) (using add)
Delete Item from Cache
Flush all Items in Cache
Enumeration Actions
Enumerate all items in cache
Employ LINQ Expressions
Cache Dependencies
Cache Dependency – File
Cache Dependency – Other Cache Item (write your own extension)
Expirations
Expiration – Absolute Time
Expiration  РSliding Time
Expiration – Extended Formats

* Extended time format

“<Minute> <Hour> <Day of month> <Month> <Day of week>”

* means run every period

Examples

o “* * * * *” expires every minute

o “5 * * * *” expire 5th minute of every hour

o “* 21 * * *” expire every minute of the 21st hour of every day

o “31 15 * * *” expire 3:31 PM every day

o “7 4 * * 6” expire Saturday 4:07 AM

o “15 21 4 7 *” expire 9:15 PM on 4 July

Others
Item priority
Run function when item is removed
Get number of items in cache
Limit number of items in cache
Can use persistent Storage
Run function to refresh item when expires

Leave a Reply

Your email address will not be published. Required fields are marked *