How does one handle the resource_exists callback in cowboy? After all, to find out whether resource exists - I must query (e.g. database) for resource. But then during the AcceptResource callback (e.g. to_html) I must query for the resource again. Is there any way to prevent this double querying?
Is there any way to preserve that resource for the AcceptResource callback, so that I don't have to pull it form database again?
Reading the cowboy docs, there is flowchart of how a rest request is handled.
In it, the callback resource_exists is called first.