Skip to content

Instantly share code, notes, and snippets.

@ferdousulhaque
Created August 5, 2025 10:24
Show Gist options
  • Select an option

  • Save ferdousulhaque/1c9fc5a27ea026dadc23c7fc2daa8230 to your computer and use it in GitHub Desktop.

Select an option

Save ferdousulhaque/1c9fc5a27ea026dadc23c7fc2daa8230 to your computer and use it in GitHub Desktop.
def getListProducts():
# Check in Cache
getList = Cache.get('products')
# If Cache-Hit miss then call Database
if getList == False:
# get from Database
getList = ProductsModel.getAllinJson()
# push to Cache
Cache.set(getList, DAILY_24HR_TTL)
return getList
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment