symphonists / cachelite

Dead simple caching extension for the Symphony CMS. Uses the CacheLite library.
Other
19 stars 11 forks source link

Possible "duplicates" errors #13

Closed nitriques closed 10 years ago

nitriques commented 10 years ago

I came across a bug in a production website. Some pages have a lot of query strings, and the length of 255 chars on the page column is not enough.

I quickly fixed it using ON DUPLICATE KEY UPDATE, but I feel that this is more of a hack then anything else.

I do not think that this is a good key. I really think that we should MD5 (or SHA-X) the serialized $_GET in order to be sure that we are dealing with a fixed length thingny.


I really like this extension BTW. Would adding APC and/or memcached as alternate storage would be useful to anyone ?

nitriques commented 10 years ago

Replacing line 21 with this did the trick:

$this->_url = hash('sha512', serialize($this->_get));
nitriques commented 10 years ago

But maybe we should only sha the thing before the DB.... Anybody ?

DavidOliver commented 10 years ago

Would adding APC and/or memcached as alternate storage would be useful to anyone?

I have APC installed on my VPS now, so yes. :) But maybe you want to use memcached instead - is it the longer term solution now?

nitriques commented 10 years ago

Memcache needs a Memchache server (memchached) so I really think that both (APC and Memcache) are still valid, since not everybody would want to setup the memchache server. But I'm glad I'm not the only one thinking that add those is good!

DavidOliver commented 10 years ago

Sorry - I was confusing Memcache with Optimizer+ which is part of PHP 5.5 by default. I was thinking that it would be better to use PHP's default than APC, but Optimizer+ doesn't do user/data caching, only opcode caching.

I read that it's still possible to use a version of APC (APCu) which doesn't conflict with Optimizer+ with PHP 5.5. So APC(u) support would be great for me. :)

nitriques commented 10 years ago

Good! Thanks for the info!

nitriques commented 10 years ago

Closed as per #14