ZiNgA BuRgA
Fag
Posts: 3,357
Joined: Jan 2008
|
RE: Cache or Query??
Since it rarely gets updated, and unlikely to have a lot of entries (having a lot of sites is going to be awkward) so the cache seems fine to me.
As you said, it's a bit of a tradeoff between memory usage, and possibly filesystem usage (if cache is stored in files) vs a separate query.
I wouldn't be too concerned about the relatively small amount of memory overhead for that plugin. Remember that code itself is loaded into memory, including all PHP interpreter overheads, and the plugin file probably consumes quite significantly more than 2KB on every page load. My first point of call to reducing the amount of memory usage would be to split up code that's rarely loaded (ie ACP stuff) into a separate file. This actually possibly does more than you think, including less code loaded, less code that needs to be parsed, and potentially less stress on an opcode cache. If you can't be bothered to really do that, then I wouldn't worry about the overhead of the datacache.
But if you do, there's some things you can do to reduce memory with the cache:
- remove stuff you never use, eg 'ssid' (actually, it seems that you never use it - I'd personally make 'nicename' the primary key)
- make your own simple cache - not hard to do, just simply export stuff to a file in the cache directory, and you can only load it during showthread
MyBB's memory cache (memcache, xcache etc) is kinda pointless, in fact, the idea of MyBB's cache has gone a bit wonky and it doesn't quite fit the typical definition of a cache, but nonetheless...
My Blog
(This post was last modified: 01-22-2011 11:40 AM by ZiNgA BuRgA.)
|
|
01-22-2011 11:38 AM |
|