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
Solved! Go to Solution.
Views
Replies
Total Likes
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].
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.
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/*" }
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>
Hello @san_11
Apache mod_headers
directives also control the Cache-Control headers. Please refer to:
The filters configuration shared by you for publisher_filter.any, should control access, not caching.
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>
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!
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].
Views
Likes
Replies
Views
Like
Replies