Added caching capability to esc()