make cache func