i am having a custom template for rendering a medialink url from a paragraph media entity ref field.
In production with twig cache activated, modifiying the media attached file , does not update the content making reference to that media, unless the render cache is emptied.
paragraph--link-media.html.twig
{% set classes = [
'paragraph',
'paragraph-link-media',
] %}
{% set link_classes = [] %}
{% set aria_label = "" %}
{% set aria_describedby = "" %}
{% if content.field_aria_title|field_value %}
{% set aria_label = content.field_aria_title|field_value|render %}
{% endif %}
{% if content.field_link_description|field_value %}
{% set aria_describedby = "link-description-"~paragraph.id() %}
{% endif %}
{% if content.field_link_style|field_value %}
{% set link_classes = link_classes|merge(['cta-link']) %}
{% set classes = classes|merge([content.field_link_style.0["#options"].entity.field_class_name.value]) %}
{% endif %}
{% if content.field_link_extra_styles|field_value %}
{% for extra_style in content.field_link_extra_styles|field_value %}
{% set classes = classes|merge([extra_style["#options"].entity.field_class_name.value]) %}
{% endfor %}
{% endif %}
{% if content.field_link_fa_style|field_value %}
{% set classes = classes|merge(['link-fa']) %}
{% endif %}
{% block paragraph %}
{% block content %}
{% if content.field_link_style|field_value %}
{% if content.field_cta_align|field_value %}
{% set class_cta_align = content.field_cta_align|field_value %}
{% else %}
{% set class_cta_align = "cta-center" %}
{% endif %}
<div class="{{ class_cta_align }}">
{% endif %}
<span{{ attributes.addClass(classes) }}>
{% set attributes_link = create_attribute() %}
{% if aria_label != "" and content.field_link_description|field_value and not content.field_link_style|field_value %}
{% set attributes_link = attributes_link.setAttribute('aria-label', aria_label).setAttribute('aria-describedby', aria_describedby) %}
{% elseif content.field_link_description|field_value and not content.field_link_style|field_value %}
{% set attributes_link = attributes_link.setAttribute('aria-describedby', aria_describedby) %}
{% elseif aria_label != "" %}
{% set attributes_link = attributes_link.setAttribute('aria-label',aria_label) %}
{% endif %}
{% if link_media.url|length>0 %}
<a {{ attributes_link.addClass(link_classes) }} href="{{ link_media.url }}">
{% endif %}
{% if content.field_link_fa_style|field_value %}
{{ content.field_link_fa_style.0["#options"].entity.field_fa_code.value|raw }}
{% endif %}
How can i fix that ?
The auto_reload: true does not seem to be recommended in production and specific conf to a theme does not seem to be possible
https://www.drupal.org/project/drupal/issues/2002606