Graphene-based photodetector with two cavities