fix cache dir name given pattern