elgg_get_simplecache_url & elgg_register_simplecache_view
|Reported by:||jtilson||Owned by:|
I'm sure this has been discussed before, but I wanted to open up an official ticket in regards to the 'registering for simplecache' process.
Right now it's a two step process: (ie: blogs)
$blog_js = elgg_get_simplecache_url('js', 'blog/save_draft'); elgg_register_simplecache_view('js/blog/save_draft');
Can't these two steps be combined?
I realize there's a warning in the comments for 'elgg_get_simplecache_url' that states that you have to call 'elgg_register_simplecache_view' in order for it to work. The problem is if a dev forgets to call the register function (ie: https://github.com/Elgg/Elgg/commit/e57ad78561dd4e80eb3621475aaade030c0fbdd0) the simplecache will be regenerated on every page load.
You can test this out on a clean install by commenting out:
in the blog plugin, and then hit the 'add blog' page. If you watch the net activity in firebug/web inspector, you can see the 'lastcache' timestamp updating on each load.
Since we're clearly warned in the code documentation to call elgg_register_simplecache_view I wouldn't call this a bug, but it'd be nice if this could be handled automatically.