Expand my Community achievements bar.

SOLVED

AEM dispatcher url AEM assets video is showing cache-control: no-cache, no-store

Avatar

Level 2

in aem dispatcher url a mp4 video to taking much time to load and the video is showing cache-control: no-cache, no-store, in network. this mp4 video is from aem assets.

i think there is some issue with aem dispatcher cache configuration 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Caching of videos is dependent on browser behaviour. First, you have to understand data streaming concept. Browsers like chrome do not send a complete load request instead they request data in chunks. That's where you need a streaming solution like Dynamic Media (Secen7), BrightCove, Youtube etc. From best practise perspective, small size videos (in KBs) are ok to store in AEM but not large size videos unless you have a CDN in-front. So an ideal implementation would cache the videos at CDN level or use a streaming solution (More often they too have inbuilt/ embedded CDN layer). Further, read this article which throws good light on why your solution should not depend on video caching at browser rather than banking streaming capabilities/ CDN for performance- [0].

 

[0]- https://stackoverflow.com/questions/31645892/caching-videos-returning-206-on-aem-dispatcher-running-... 

View solution in original post

8 Replies

Avatar

Community Advisor

if cache-control is no-cache then dispatcher and cdn will not cache the response from publisher as it respects the header.

You need validate your configuration in publisher or is there any filter is implemented for the same.

 

Avatar

Level 2

in our project dispatcher we have publisher_filter.any in that we have 

/0010 { /type "allow" /extension '(webm|mpg|mpeg|ogg|mp4|avi|css|eot|gif|ico|jpeg|jpg|js|gif|pdf|png|svg|swf|ttf|woff|woff2|html|mp3|xls|xlx|xlsx|txt|docx|doc)' /path "/content/*" }

Avatar

Community Advisor

@san_11 :

this is to allow the url to publisher . 

But you need to check under /cache section whether you are caching the .mp4 or not. 

 

Thanks 

siva

Thanks,
Siva

Avatar

Level 2

in my dispatcher there is one file prod-cache.rules in this we have 

<LocationMatch "^\/content\/dam\/.*">
Header set Cache-Control "public, max-age=43200, s-maxage=604800"
Header set Edge-Control "max-age=604800"
</LocationMatch>

Avatar

Community Advisor

Hello @san_11 

 

Apache mod_headers directives also control the Cache-Control headers. Please refer to:

 

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/implementing/conten...

 

 

The filters configuration shared by you for publisher_filter.any, should control access, not caching.


Aanchal Sikka

Avatar

Level 2

yes in my dispatcher there is one file, prod-cache.rules in this we have 

<LocationMatch "^\/content\/dam\/.*">
Header set Cache-Control "public, max-age=43200, s-maxage=604800"
Header set Edge-Control "max-age=604800"
</LocationMatch>

Avatar

Community Advisor

Hi @san_11 ,
Check with different browser like IE and Chrome if there is any difference in caching behavior.
There are certain conditions under which dispatcher caches the content that it serves, one of which is – Response Code should be 200.
Probably in chrome you should be getting response code 206 because chrome use partial Content strategy to load and in IE you should be getting 200.

If the above is true then trigger dispatcher flush when author publish the video and write a custom script that will make a request to download full video with the same headers that IE uses, i.e. which in turn would automatically cache video on dispatcher.
Doing this will make the video cache right after it is published and not waiting for it to be cached when it is played through browser.
Hope this helps!

Avatar

Correct answer by
Employee Advisor

Caching of videos is dependent on browser behaviour. First, you have to understand data streaming concept. Browsers like chrome do not send a complete load request instead they request data in chunks. That's where you need a streaming solution like Dynamic Media (Secen7), BrightCove, Youtube etc. From best practise perspective, small size videos (in KBs) are ok to store in AEM but not large size videos unless you have a CDN in-front. So an ideal implementation would cache the videos at CDN level or use a streaming solution (More often they too have inbuilt/ embedded CDN layer). Further, read this article which throws good light on why your solution should not depend on video caching at browser rather than banking streaming capabilities/ CDN for performance- [0].

 

[0]- https://stackoverflow.com/questions/31645892/caching-videos-returning-206-on-aem-dispatcher-running-...