Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sw360-dev] nxginx and caching of 100s of css files ...

Hi,

Yes, it seems a good addition to the sw360chores project. And btw we were thinking about introducing a dev (allows hot deployment of war files etc) and a prod (configuration is fixed) container configuration.
Maybe it makes sense to also have some specific http server configurations for both environments. Extensive caching in a dev env is maybe something you don't want to have ...

Mit freundlichen Grüßen / Best regards

Johannes Kristan
INST-CSS/BSV-OS  

Tel. +49 30 726112-432 


-----Ursprüngliche Nachricht-----
Von: sw360-dev-bounces@xxxxxxxxxxx [mailto:sw360-dev-bounces@xxxxxxxxxxx] Im Auftrag von Jaeger, Michael C.
Gesendet: Donnerstag, 8. Juni 2017 18:27
An: sw360 developer discussions <sw360-dev@xxxxxxxxxxx>
Betreff: [sw360-dev] nxginx and caching of 100s of css files ...

Hi,

we discussed the thing that a single page load involves somewhat between 110-140 individual GET requests, vast majority is for *.css, *js and such files.

I tried to enable caching for nginx, actually was kind of not so obvious, because it needs to be applied for the proxied traffic (coming from tomcat, which sets the http fields already), so plain nginx configurations from the Web did not work.

What does seem to work is:


    location ~*  \.(jpg|jpeg|png|gif|ico|css|js)$ {

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_redirect off;
        proxy_pass  http://liferay-app;
        proxy_read_timeout 3600s;

        proxy_set_header expires 7d;
    }

-> just adding the proxy_set_header to the proxied http header fort he expires value.

Question: shall we take this into the deployment setting of nginx fort he sw360chore project? It is maybe not useful for development, but  for proudction use it appears like a useful additon. on a quick testign it seem sto reduce the load timest by 25-50% - admitted not really tested, because I did not ensure for same server conditions ...

Kind regards, Michael
_______________________________________________
sw360-dev mailing list
sw360-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/sw360-dev


Back to the top