Improved cache example