Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Liferay 7.2 + AWS Cloudfront - Issue
I am trying to setup CDN with Liferay using AWS Cloudfront.However, after setting up CDN properties as per liferay documenation , Liferay generate CDN URLs for combo java-scripts. Because combo javascripts are dynamic resources it does not get cached at CDN and gives 404 error for all such combo javascript resources.Has anybody successfully configured Liferay with AWS Cloud front? Please share your thoughts on error.
I had a similar issue with 7.0 and ended up using a custom jsp bag to replace top_head.jsp and change the way it behaves. We actually did a lot more, since we have multiple cdn services in use for different parts of the world, but I think, combo was in there. Somewhere in that file the urls for all kinds of includes are inserted in the page.
https://help.liferay.com/hc/en-us/articles/360017881172-JSP-Overrides-Using-Custom-JSP-Bag-
But I am not sure why you get 404 errors. Maybe you should look on cdn side if you could change the configuration. I am not familiar with AWS, but it should be possible to make it behave like a reverse proxy without caching.
https://help.liferay.com/hc/en-us/articles/360017881172-JSP-Overrides-Using-Custom-JSP-Bag-
But I am not sure why you get 404 errors. Maybe you should look on cdn side if you could change the configuration. I am not familiar with AWS, but it should be possible to make it behave like a reverse proxy without caching.
Thank you Christoph for your reply.
As per Liferay Documentation, https://docs.liferay.com/dxp/portal/7.2-latest/propertiesdoc/portal.properties.html#Content%20Delivery%20Network It mentions that if below property is used the liferay will work with AWS (and it will not load dynamic resources from CDN.)
Also, on your suggestion on overriding top_head.jsp; In liferay 7.2 these combo javascripts are getting added from Dynamic Include and I am not sure how to override them. I only see options to extend it here.
We are getting 404 because combo resources are not getting cached at CDN; I will look into further if reverse proxy like configuration is available with AWS Cloudfront.
Thank you Again!
As per Liferay Documentation, https://docs.liferay.com/dxp/portal/7.2-latest/propertiesdoc/portal.properties.html#Content%20Delivery%20Network It mentions that if below property is used the liferay will work with AWS (and it will not load dynamic resources from CDN.)
cdn.dynamic.resources.enabled=false
But in reality, its still tries to get dynamic resources from CDN.Also, on your suggestion on overriding top_head.jsp; In liferay 7.2 these combo javascripts are getting added from Dynamic Include and I am not sure how to override them. I only see options to extend it here.
We are getting 404 because combo resources are not getting cached at CDN; I will look into further if reverse proxy like configuration is available with AWS Cloudfront.
Thank you Again!
I checked the code and I see the change. Meh. I am quite sure that we will run into several issues with that code being in a DynamicInclude classe now. Meh.
It also seems that the code doesn't use the dynamic cdn url at all. getCDNDynamicResourcesHost is only used in jsps and jspf files. I'd say, that's a bug. If you are using DXP, you could open a ticket for it.
It also seems that the code doesn't use the dynamic cdn url at all. getCDNDynamicResourcesHost is only used in jsps and jspf files. I'd say, that's a bug. If you are using DXP, you could open a ticket for it.
Yes. Already have ticket for this.
Is anyone out there who successfully integrated AWS Cloudfront CDN with Liferay DXP/7.2?
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™