Comments (6)
note: One can enable serverside caching for nginx via:
diff --git a/deployment/sw360nginx/docker-entrypoint.sh b/deployment/sw360nginx/docker-entrypoint.sh
index 0b51af5..f3ec720 100755
--- a/deployment/sw360nginx/docker-entrypoint.sh
+++ b/deployment/sw360nginx/docker-entrypoint.sh
@@ -32,9 +32,14 @@ if [ "$NGINX_CERTIFICATE" ] && [ "$NGINX_KEY_PRIV" ]; then
fi
fi
+mkdir -p /data/nginx/cache
+
################################################################################
## generate /etc/nginx/conf.d/nginx-sw360.conf
cat <<EOF > "/etc/nginx/conf.d/nginx-${HOST}.conf"
+proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=sw360_cache:10m max_size=10g
+ inactive=60m use_temp_path=off;
+
upstream ${HOST}-app {
server ${HOST}:${HOST_PORT} max_fails=3;
}
@@ -69,6 +74,8 @@ server {
proxy_redirect off;
proxy_pass http://${HOST}-app;
proxy_read_timeout 3600s;
+
+ proxy_cache sw360_cache;
}
}
EOF
Whether this has a positive effect or whether this even leads to problems has to be checked.
from sw360chores.
Related Issue: sw360/sw360portal#397 "Implement a Benchmark to messure Tomcat performance"
from sw360chores.
Client side caching can be enforced via
diff --git a/deployment/sw360nginx/docker-entrypoint.sh b/deployment/sw360nginx/docker-entrypoint.sh
index 0b51af5..c3856e3 100755
--- a/deployment/sw360nginx/docker-entrypoint.sh
+++ b/deployment/sw360nginx/docker-entrypoint.sh
@@ -35,6 +35,14 @@ fi
################################################################################
## generate /etc/nginx/conf.d/nginx-sw360.conf
cat <<EOF > "/etc/nginx/conf.d/nginx-${HOST}.conf"
+map \$sent_http_content_type \$expires {
+ default off;
+ text/html epoch;
+ text/css max;
+ application/javascript max;
+ ~image/ max;
+}
+
upstream ${HOST}-app {
server ${HOST}:${HOST_PORT} max_fails=3;
}
@@ -69,6 +77,8 @@ server {
proxy_redirect off;
proxy_pass http://${HOST}-app;
proxy_read_timeout 3600s;
+
+ expires \$expires;
}
}
EOF
from sw360chores.
the expires map did not work for me. as I tested the expires setting wth the dev tools browser. Have you tried it?
Another question would be for me to have the java scripts (and css) at max expiration for production. I suspect that updated css and Javascripts will not propagate then to the client?
from sw360chores.
OK, I see that the expiration does not count here, because the liferay requests use the timestamp syncing of the build time.
Question: did you observe improvements using the local proxy cache?
from sw360chores.
actually, I am not sure if the expires map proposal works, because eventually we found that the tomcat-served files are passed through at nginx and therefore the nginx needs to be configured as proxy rewrite.
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_hide_header expires;
proxy_redirect off;
proxy_pass http://liferay-app;
proxy_read_timeout 3600s;
proxy_set_header expires 7d;
}
from sw360chores.
Related Issues (20)
- Configure NGINX for CVESEARCH so that an extra route on port 443 exists
- Adjust vagrant script so that it provisions complete SW360 docker setup HOT 1
- Running SW360 with Fossology and CVE search HOT 14
- Provision the empty containers with the content from the liferay configuration (e.g. settings and lar stuff)
- docker setup does not seem to run with macosx HOT 1
- Update to Liferay 7.1 HOT 1
- missing space in docker-entrypoint.sh
- Helm deployment HOT 1
- deploy dockers to a registry (docker hub for instance)
- Configure admin user via docker bringup HOT 1
- Cannot create resource output directory: /couchdb-lucene/target/classes -> [Help 1] HOT 2
- Readme not correct HOT 4
- Hardcoded Commit of cve-search no longer works. NVD XML retirement.
- Components page is temporarily unavailable HOT 7
- Deployment to Tomcat does not work reliably
- Improvements of proxy support during Docker image builds
- update couchdb backup link
- Help needed with running SW360 - 502 Bad Gateway HOT 3
- Update recently added dependency commons compress
- Error connecting SW360 to Fossology REST API
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sw360chores.