tedious / Stash

The place to keep your cache.
http://www.stashphp.com
BSD 3-Clause "New" or "Revised" License
961 stars 133 forks source link

Feature Request: Prefixes #319

Closed exts closed 8 years ago

exts commented 8 years ago

So I was thinking , wouldn't it be nice to add a prefix to every getItem call to almost namespace off different domains using the same memcache server rather than setting up a few more memcache servers for minor caching? Now this could be done by simply extending the library, but why not just make it an official feature?

So I was thinking if we could add a setPrefix() method which takes one parameter allowing only [a-zA-Z0-9_-.] characters which gets prepended to every getItem, getData and setData key

limenet commented 8 years ago

@exts I hope you don't mind my asking: have you had a look at Pool::setNamespace()? Or rather: how is your proposed setPrefix() different from setNamespace()?

I'm using setNamespace() in a setup where multiple virtual hosts point to the same physical directory serving the same application on different subdomains and setting the namespace equal to the subdomain works just fine.

exts commented 8 years ago

Did not know that existed, thanks.