Fix #294 keyword_pattern problem
Improve cache timing