Added memcaching into topHandler function.