improve code about getting local cache file path