If you want to disable cache for only a specific set of pages, then you can follow the below approach. in the page, properties put a checkbox, and on the selection of checkbox just load the below JSP file.
<sly data-sly-include="no-cache.jsp" />
Inside the .jsp file call no-cache code.
Enable it for components:
I recommend you to use sling dynamic include for the dynamic components, it gives a lot of advantages when we compare with other approaches. you don't need to set response headers in the sling model, all you need to do is just configuration, check below article for more information.