#48 Wildcards for mmcache_rm()

open
nobody
None
5
2004-11-14
2004-11-14
marekk
No

Hi !

During my developer days I came through many
optimization & caching tools for php, but since I
discovered Truck mmcache, I can't imagine using
anything else. Excelent work !!!

What I miss is some grouping for the cached keys.
For example, I cash results of the DB queries for some
list of data, and I use paging (Next - Previous page)
to display the results.

Example:
"SELECT * FROM table LIMIT 0, 20"

This query I store with key: "list_0_20"
If the user requests next page, I store it like:
"list_20_40"

The problem appears, when something is changed in the
table, and I want to remove the keys, so the cache gets
refreshed with live data. But as I don't know how many
pages are stored in the cache.

Excelent solution to this would be calling:
mmcache_rm("list_*");

Which would delete all keys starting with string "list_".

I realize that it could cause potential problems on
shared webservers, so it could be disabled by
compilation by default.

Is it possible to add such feature ?

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks