# Browser Caching mit NGINX als Reverse Proxy

**URL:** https://forum.shopware.com/t/browser-caching-mit-nginx-als-reverse-proxy/10132
**Category:** Shopware 3.5
**Tags:** installation--gettin
**Created:** [27. November 2012 um 19:03 UTC](https://forum.shopware.com/t/browser-caching-mit-nginx-als-reverse-proxy/10132 "2012-11-27T19:03:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Julian](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Julian](https://forum.shopware.com/u/Julian)
#### Post date: [27. November 2012 um 19:03 UTC](https://forum.shopware.com/t/browser-caching-mit-nginx-als-reverse-proxy/10132/1 "2012-11-27T19:03:32Z")

</div>

Guten Abend 🙂 im Moment nutze ich das Browser Caching noch gar nicht sprich Bilder , CSS Dateien etc. werden bei jedem einzelnen Aufruf neu geladen was natürlich schlecht ist ☹ für Apache gibt es ja ein Tutorial im Labs Bereich, welches mir in diesem Fall leider nicht weiterhilft. kann mir jmd. helfen wie man die nginx.conf bearbeiten muss um das Browser-Caching zu nutzen. so sieht meine config derzeit aus: #user nginx; worker\_processes 1; #error\_log /var/log/nginx/error.log; #error\_log /var/log/nginx/error.log notice; #error\_log /var/log/nginx/error.log info; #pid /var/run/nginx.pid; events { worker\_connections 1024; } http { include /etc/nginx/mime.types; access\_log /var/log/nginx/access.log; sendfile on; #tcp\_nopush on; #keepalive\_timeout 0; keepalive\_timeout 2; tcp\_nodelay on; server\_tokens off; gzip on; gzip\_http\_version 1.1; gzip\_vary on; gzip\_comp\_level 6; gzip\_proxied any; gzip\_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js; gzip\_buffers 16 8k; gzip\_disable “MSIE [1-6].(?!.\*SV1)”; include /etc/nginx/conf.d/\*.conf; include /etc/nginx/sites-enabled/\*; }

---

<div class="post-metadata">

### Author: ![Benjamin\_Cremer](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@Benjamin\_Cremer](https://forum.shopware.com/u/Benjamin_Cremer)
#### Post date: [28. November 2012 um 08:32 UTC](https://forum.shopware.com/t/browser-caching-mit-nginx-als-reverse-proxy/10132/2 "2012-11-28T08:32:53Z")

</div>

Hallo, ich habe meine Nginx-Konfiguration in diesem [Gist](https://gist.github.com/4024794) zur Verfügung gestellt. Der Relevante-Part für das HTTP-Caching ist folgender: ` location ~\* ^.+\.(?:css|js|jpe?g|gif|ico|png|html|xml)$ { expires 1w; add\_header Pragma public; add\_header Cache-Control "public, must-revalidate, proxy-revalidate"; } ` Viele Grüße, Benjamin Cremer :shopware:

---

<div class="post-metadata">

### Author: ![Julian](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Julian](https://forum.shopware.com/u/Julian)
#### Post date: [4. Dezember 2012 um 16:10 UTC](https://forum.shopware.com/t/browser-caching-mit-nginx-als-reverse-proxy/10132/3 "2012-12-04T16:10:18Z")

</div>

Hallo Benjamin, das musste bei mir doch im Apache konfiguriert werden, wenn NGINX nur als reverse-proxy läuft scheint man das nicht in der nginx.conf konfigurieren zu können.
