Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Set Content Type not working on AEM cloud Dev author/publish

Avatar

Level 2

Hi,

 

I'm trying to set the content type of .wasm files to "application/wasm" by adding this code on the project's ../available_vhosts/.vhost file. Here's the code I'm referring to:

<LocationMatch "\.(?i:wasm)$">
Header Set Content-Type application/wasm
Header set Content-Disposition inline
</LocationMatch>

On my local, this work perfectly fine. I can see the content type changes to "application/wasm" but when I'm pushing this code to dev, it seems like it doesn't take any effect at all. Any idea what could be the issue? Any help is greatly appreciated. Thanks!

6 Replies

Avatar

Community Advisor

Hi @zmdeluyas ,

If it is AEM cloud hope dispatcher deployment happened which we miss sometimes.

Also you may try ForceType mentioned in below thred

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/content-disposition-on-aem...

Hope apache restarted.

Also if file might have been cached without header then it might be serving from cache

 

Thanks

Avatar

Level 2

Yes, the environment is on AEM cloud. I'm pretty sure we are running dispatcher pipeline and with no issues. I'll try using the force type you have mentioned. I tried this on my local but it doesn't work so hopefully on cloud it works. Also I added no cache for wasm as well. 

Avatar

Level 2

After changing it to ForceType still doesn't work. This is the latest code I added including the no cache. After the deployment on cloud was done, I clear cached and tried on incognito but the content type still not changing. 

<LocationMatch "\.(?i:wasm)$">
ForceType application/wasm
Header set Content-Disposition inline
Header unset Cache-Control
Header unset Expires
Header always set Cache-Control "no-cache,max-age=0"
Header set Age 0
</LocationMatch>

Avatar

Community Advisor

Hi, 

Double check the changes are reflected in the "../enabled_vhosts/.vhost" file, and make sure you are not seeing cached content, try it on an incognito window. 



Esteban Bustamante

Avatar

Level 2

I have tried to clear cache, incognito and other browsers but it's really not working. Also, my changes is reflected on ../enabled_vhosts/.vhost which means the symlink I created is valid. 

Avatar

Administrator

@zmdeluyas Did you find the suggestions from users helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!



Kautuk Sahni