perf: #3611578 Lazy-load share popup and make AJAX response cacheable

The popup markup was fetched via AJAX on every page load, even when the user never opened it, and the controller returned an uncacheable JsonResponse, so every request hit the Drupal backend. The popup is now fetched only on the first click of a share trigger, and the controller returns a CacheableJsonResponse with cache metadata derived from the render array (config cache tag, language cache context, max-age) plus an s-maxage header so reverse proxies and CDNs can cache it.

By: trebormc

Closes #3611578

Merge request reports

Loading
Loading