The answer depends on how you want to handle it, but if your question is if it's possible to cache vanity pages, where vanity is configured on AEM page property, the answer is yes, you can cache it on the dispatcher.
My approach would be:
- Add a rewrite rule on apache to prefix /content/page/context/path of your site on all requests without extn in it.
- suffix .html also in same request
- Dispatcher will cache your page /content/page/context/path/<vanity>.html
The downside will be with cache flush, as the dispatcher cache flush agent will flush the actual page path only and not vanity. You can do vanity configuration on dispatcher [1].
I suggest you also check ACS commons Redirect Manager [2] to handle vanity.
If possible, i recommend to handle vanity via Apache rewrites (301 or PASS Through)
Thanks
Mohit
[1] https://experienceleague.adobe.com/docs/experience-manager-dispatcher/using/configuring/dispatcher-configuration.html?lang=en
[2] https://adobe-consulting-services.github.io/acs-aem-commons/features/redirect-manager/index.html