fix randomwiki fatal error and optimize caching