掲示板
Regarding serving images from web server
10年前 に Nalini Mathusoothanan によって更新されました。
Regarding serving images from web server
New Member 投稿: 19 参加年月日: 13/06/20 最新の投稿
Hi,
We are using Liferay 6.1.3 GA3, bundled with jboss. We are using apache webserver.
Our requirement is >>
1. Load the images through documents and Media
2. The images need to be loaded in Apache web server instead of liferay location. [We can use network shared location instead of local liferay location]
3. When selecting the image in web content, it will use webserver location and generate the URL of web server. [As per our analysis it requires customization in Documents and Media portlet.]
Is there out of box feature available to handle this scenario? Could you please help us?
Regards,
Nalini
We are using Liferay 6.1.3 GA3, bundled with jboss. We are using apache webserver.
Our requirement is >>
1. Load the images through documents and Media
2. The images need to be loaded in Apache web server instead of liferay location. [We can use network shared location instead of local liferay location]
3. When selecting the image in web content, it will use webserver location and generate the URL of web server. [As per our analysis it requires customization in Documents and Media portlet.]
Is there out of box feature available to handle this scenario? Could you please help us?
Regards,
Nalini
10年前 に David H Nebinger によって更新されました。
RE: Regarding serving images from web server
Liferay Legend 投稿: 14915 参加年月日: 06/09/02 最新の投稿
no.
an image in liferay is not just an image file. It's also privileges, auditing, metadata, ... None of those things are available by serving the image file through apache, which is why it is not supported.
an image in liferay is not just an image file. It's also privileges, auditing, metadata, ... None of those things are available by serving the image file through apache, which is why it is not supported.
10年前 に Nalini Mathusoothanan によって更新されました。
RE: Regarding serving images from web server
New Member 投稿: 19 参加年月日: 13/06/20 最新の投稿
We are using liferay images for mobile application. We are expecting more than 1 million request per day. Will Liferay provide the capability of serving these requests?
Could you please suggest any alternatives?
Could you please suggest any alternatives?
10年前 に J. Manuel Navarro によって更新されました。
RE: Regarding serving images from web server
Regular Member 投稿: 138 参加年月日: 14/01/24 最新の投稿
Hey!
Liferay performance will be limited only by your resources, as any other JavaEE server: available memory, network bandwidth, number of cores and so on. However, static content is always recommended to be served by a front server (Apache, Nginx...), not for a back server (Tomcat, Glassfish...).
Liferay supports CDN setup in order to serve static content (JS, CSS and theme images mainly) but if you're serving images from your Document&Media, those are not included in Liferay's builtin CDN support.
To solve this scenario, one possible solution could be to setup a proxy cache server or even a CDN server (like Cloudfront in Amazon, Akamai...), which will store copies of your images (even geographically distributed for CDN).
If you choose the CDN path, it must support "pull mode", because Liferay will not make any sync process. The CDN is responsible to request resources when cache-miss occurs.
If you client is a mobile device, consider also to setup a transcoding proxy. If you're not used to the idea, you can read this document (Design of A Transcoding Proxy Server for Mobile Web Browsing, a bit outdated but useful anyway)
And as David noted, keep in mind that if you use a proxy cache (CDN or not), security mechanisms offered by Liferay should be bypassed and your static files will be accesible for everyone. You can develop some workaround in order to solve this.
Regards!
JM
Liferay performance will be limited only by your resources, as any other JavaEE server: available memory, network bandwidth, number of cores and so on. However, static content is always recommended to be served by a front server (Apache, Nginx...), not for a back server (Tomcat, Glassfish...).
Liferay supports CDN setup in order to serve static content (JS, CSS and theme images mainly) but if you're serving images from your Document&Media, those are not included in Liferay's builtin CDN support.
To solve this scenario, one possible solution could be to setup a proxy cache server or even a CDN server (like Cloudfront in Amazon, Akamai...), which will store copies of your images (even geographically distributed for CDN).
If you choose the CDN path, it must support "pull mode", because Liferay will not make any sync process. The CDN is responsible to request resources when cache-miss occurs.
If you client is a mobile device, consider also to setup a transcoding proxy. If you're not used to the idea, you can read this document (Design of A Transcoding Proxy Server for Mobile Web Browsing, a bit outdated but useful anyway)
And as David noted, keep in mind that if you use a proxy cache (CDN or not), security mechanisms offered by Liferay should be bypassed and your static files will be accesible for everyone. You can develop some workaround in order to solve this.
Regards!
JM
9年前 に bitsof info によって更新されました。
RE: Regarding serving images from web server
Junior Member 投稿: 46 参加年月日: 12/11/12 最新の投稿
Where is the documentation on how to use the CDN features within liferay?
9年前 に David H Nebinger によって更新されました。
RE: Regarding serving images from web server
Liferay Legend 投稿: 14915 参加年月日: 06/09/02 最新の投稿
http://www.google.com, did "liferay CDN", obvious hits are:
https://www.liferay.com/community/wiki/-/wiki/Main/Content+Delivery+Network
https://www.liferay.com/web/zeno.rocha/blog/-/blogs/alloyui-and-the-importance-of-cdn
etc...
https://www.liferay.com/community/wiki/-/wiki/Main/Content+Delivery+Network
https://www.liferay.com/web/zeno.rocha/blog/-/blogs/alloyui-and-the-importance-of-cdn
etc...
9年前 に Gustavo Herrera によって更新されました。
RE: Regarding serving images from web server
New Member 投稿: 1 参加年月日: 13/06/20 最新の投稿
Thanks for googling that, but still a lot of information is not documented anywhere.
In the first link: https://www.liferay.com/community/wiki/-/wiki/Main/Content+Delivery+Network
There is a question since August 6th 2010 without answer: "Would be nice to know how to get your static files out of liferay in order to be able to synchronize the CDN and the parent liferay site. Any help would be appreciated."
The second link talks about using an external CDN for AlloyUI, so it's irrelevant for this discussion.
How the CDN solution works?
What files are expected OOB to be served by the CDN?
How do I "export" them?
I've configured the CDN url in portal-ext.properties, I can see it in the web console, but it has had no effect in Liferay! Still all the content is served with local urls.
I know how to google, but it's impossible to find something that is not documented anywhere.
Regards,
In the first link: https://www.liferay.com/community/wiki/-/wiki/Main/Content+Delivery+Network
There is a question since August 6th 2010 without answer: "Would be nice to know how to get your static files out of liferay in order to be able to synchronize the CDN and the parent liferay site. Any help would be appreciated."
The second link talks about using an external CDN for AlloyUI, so it's irrelevant for this discussion.
How the CDN solution works?
What files are expected OOB to be served by the CDN?
How do I "export" them?
I've configured the CDN url in portal-ext.properties, I can see it in the web console, but it has had no effect in Liferay! Still all the content is served with local urls.
I know how to google, but it's impossible to find something that is not documented anywhere.
Regards,
9年前 に David H Nebinger によって更新されました。
RE: Regarding serving images from web server
Liferay Legend 投稿: 14915 参加年月日: 06/09/02 最新の投稿
I think you'll find that Liferay is still proxying the access to the cdn for logging, auth, and other reasons.
9年前 に Nalini Mathusoothanan によって更新されました。
RE: Regarding serving images from web server
New Member 投稿: 19 参加年月日: 13/06/20 最新の投稿
Hi,
We fixed the issue by fronting apache web server for all the image requests for liferay.
All the image request will route to apache and apache cache all the images. If the image is not available in cache it will request liferay for images and cache.
If you require more details please let me know.
Regards,
Nalini
We fixed the issue by fronting apache web server for all the image requests for liferay.
All the image request will route to apache and apache cache all the images. If the image is not available in cache it will request liferay for images and cache.
If you require more details please let me know.
Regards,
Nalini
9年前 に Krzysztof Gołębiowski によって更新されました。
RE: Regarding serving images from web server
Liferay Master 投稿: 549 参加年月日: 11/06/25 最新の投稿
As far as I remember, when the cdn.host.http/s is set, Liferay starts contructing URL's for all cacheable (in it's opinion) resources with hostname taken from that parameter instead of original one.
A good example about how it works is in ThemeDisplay.
As the javadoc says method getCDNBaseURL "Returns the content delivery network (CDN) base URL, or the current portal URL if the CDN base URL is null"
Then final URL's for images and javascript is generated:
This setting simplifies configuration of front caching servers as you don't have set it for each resource separately (eg. if jpeg/png/css then cache, otherwise skip) but you can just tell "cache everything from cdn.somehost.com and skip all content from somehost.com".
The drawback of this solution is that you rely on Liferay's decision about what is cacheable and what isn't.
Regards,
KG
A good example about how it works is in ThemeDisplay.
As the javadoc says method getCDNBaseURL "Returns the content delivery network (CDN) base URL, or the current portal URL if the CDN base URL is null"
String cdnBaseURL = getCDNBaseURL();
Then final URL's for images and javascript is generated:
setPathThemeImages(
cdnBaseURL + themeStaticResourcePath + theme.getImagesPath());
setPathThemeJavaScript(
cdnBaseURL + themeStaticResourcePath +
theme.getJavaScriptPath());
This setting simplifies configuration of front caching servers as you don't have set it for each resource separately (eg. if jpeg/png/css then cache, otherwise skip) but you can just tell "cache everything from cdn.somehost.com and skip all content from somehost.com".
The drawback of this solution is that you rely on Liferay's decision about what is cacheable and what isn't.
Regards,
KG