Optical microcavities are used in variety of applications ranging from sensors to lasers and signal routing in high volume communication networks. Achieving a high quality factor (Q) is necessary for achieving the higher sensitivity in sensing applications and for narrow linewidth light emission in most lasing applications. In this work, we propose a new way for achieving a higher quality factor in thin film, Fabry-Perot polymeric optical resonators. We show that lateral photon confinement in a vertical Fabry-Perot microcavities can be achieved by optical writing of a refractive index profile utilizing our UV-sensitive polymer. This method can improve the quality factor by one or more orders of magnitudes. In order to demonstrate this improvement, the device has been fabricated. The fabricated device consists of two dielectric Bragg reflectors with a layer of 100 μm thick polymer layer between them. The polymer is a thiol-ene/methacrylate photopolymer whose optical index can be modified utilizing standard photo-lithography processes. The refractive index of this polymer can be modified utilizing standard photo-lithography processes. The measured finesse of the fabricated device was 692 and the quality factor was 55000. The achieved finesse combined with the flexible polymer layer allows this device to be used as an ultrasound detector in optical micromachined ultrasound transducers (OMUT).