[Answer]-What is the best way to schedule a view render as a task in django-chronograph or similar?

1đź‘Ť

âś…

There are several ways I know to solve this:
1. You can use Varnish (as described in this blog post). Yet this solution takes a bit more time to get into because it’s side technology you’ll have to deal with. Also it takes more efforts to maintain it.
2. More “django-side” solution is to use django-celery for daily rendering your view and storing it in cache. You can move all your static view logic into task and render it there once a day. In your view you can just get rendered response from cache and return it to user.
3. Also you can use django per-view cache and create task in celery to clear cache daily.

👤PukeCloud

Leave a comment