A javascript function caching script