A cached function call / a cache anything function |
[eluser]Patrick Savalle[/eluser]
Copy /system/libraries/Cache/Cache.php to /application/libraries/Cache and add the method below to the class. You now have function that can cache every other function's result. Use it only for TRUE / context-free functions, i.e. functions whose result only depend on their arguments. It uses the standard codeigniter caching mechanism: http://ellislab.com/codeigniter/user-gui...ching.html It is equivalent to the standard PHP function call_user_func_array: http://php.net/manual/en/function.call-u...-array.php --> To the codeigniter team, please add this to the new release. Code: /** Example of usage: Code: $cache_adapter = 'apc'; Don't overuse this function. Only cache costly operations that form a performance bottleneck and never rely on the cache to actually store anything.
[eluser]PhilTem[/eluser]
[quote author="Patrick Savalle" date="1343047665"]... --> To the codeigniter team, please add this to the new release. ...[/quote] Make either an issue on GitHub or a pull request on the latter page. The CI team isn't here too often neither do they take anything serious that is posted here, as they also mention "(please post issues and pull requests to GitHub)"
[eluser]Patrick Savalle[/eluser]
Yes, I tried that. Github is way above my mental capacities. Sorry, I am a software developer, not a rocket scientist But be my quest.
[eluser]Patrick Savalle[/eluser]
https://github.com/EllisLab/CodeIgniter/issues/1646 |
Welcome Guest, Not a member yet? Register Sign In |