url_cache icon indicating copy to clipboard operation
url_cache copied to clipboard

Jose's refactor has merit

Open zeroasterisk opened this issue 14 years ago • 3 comments

take a look at: https://github.com/lorenzo/url_cache/commit/2f598b3884d424c3c3aebcf520844a310ae6c2a3

I like his approach - do you?

zeroasterisk avatar Apr 06 '11 20:04 zeroasterisk

Yup - I just implemented his version and I like the split-out-class and nothing constructs till beforeRender() which seems reasonable. He says it's faster and more efficient, I have not tested/compared.

I've added a few tweaks to my implementation ($this->_key by controller, and configurable cacheEngine) - but at this point my code is based on jose's version. Let me know if you'll consider adopting.

zeroasterisk avatar Apr 06 '11 20:04 zeroasterisk

hey guys I also worked on this idea of fixing the probably biggest remaining bottleneck of all :) with a paginated view there are usually 100-200 links. 100-200% gain in speed can be achieved, I realized in my experiments.

but two things: wouldnt it make more sense to split the cache files in two? file a for all controller/action pairs and file b for the page specific links (especially with named and passed params etc) the first file can only reach a specific length (controller x actions). it will be very likely that those urls will be used in other pages, as well. and therefore we create less overhead/redundancy (which means more non-cached url generations).

and the second: I added sort() to mine before creating the hash key. because it found out that the order of the array elements of same result url can lead to different hashes otherwise.

dereuromark avatar Feb 13 '12 01:02 dereuromark

I released 1.0.0: https://github.com/dereuromark/cakephp-url-cache Should we merge the repos since your's seems to be abandoned?

dereuromark avatar Apr 15 '15 10:04 dereuromark