If I use template_preprocess_file_link, can I add the current url query string and append it to the link per user? Will this link be cached for all users?
Update:
This appends it, but does seem to get cached:
if (preg_match('/private:\/\//i', $file_entity->getFileUri())) {
$query = \Drupal::requestStack()->getCurrentRequest()->query->all();
if (!empty($query)) {
$options['query'] = $query;
}
}
$variables['link'] = \Drupal::l($link_text, Url::fromUri($url, $options));