varnish

Is it possible to vary page caches (to have cache versions) with the same url and different cookie value (language)?

江枫思渺然 提交于 2019-12-08 06:42:42
问题 We have a multilanguage site and want to cache e.g. page /about . English and belarusian pages have the same URL: /about , language is stored in and detected from the cookies. En: /about , cookie: site_lang: en Be: /about , cookie: site_lang: be We have a ReverseProxy cache (SymfonyHttp or Varnish). When the first user opens the /about page with en value in cookies, it's cached by ReverseProxy and by browser. Response headers: Cache-Control max-age=600, public, s-maxage=600 Last-Modified Mon,

how to force browsers reload static assets after code deployment?

孤人 提交于 2019-12-08 03:16:51
问题 I'm running the following setup: haproxy -> web traffic -> varnish -> nginx (serve static assets) -> node.js (dynamic content) and haproxy -> websockets -> node.js How can I force browsers to refresh static assets (JavaScript, CSS, ..) after code deployment? (expire/purge the cache?) 回答1: You can add a querystring to the file with a revision number. Increasing the revision number will force all the assets to come back down to the browser. <script type="text/javascript" src="jquery.min.js?r

Stale-while-revalidate cache replacement from Varnish

走远了吗. 提交于 2019-12-08 02:16:34
问题 We are currently moving our servers to a new one, with PLESK 12.5 which doesn't support Varnish cache for our PHP applications. We use Varnish, mostly for the 'stale-while-revalidate' capability, so that we can send whole pages or parts (using ESI) without any waiting time for any customer while cache is refreshing. Is there any alternative to Varnish for a similar kind of cache ? Either another "program" that could run on PLESK, or any PHP/server cache ? PLESK comes with NGINX, but it does

Varnish to be used for https

青春壹個敷衍的年華 提交于 2019-12-07 20:46:38
问题 Here's the situation. I have clients over a secured network (https) that talk to multiple backends. Now, I wanted to establish a reverse proxy for majorly load balancing (based on header data or cookies) and a little caching. So, I thought varnish could be of use. But, varnish does not support ssl-connection. As I've read at many places, quoting, "Varnish does not support SSL termination natively" . But, I want every connection, ie. client-varnish and varnish-backend to be over https. I

Varnish Cache & Shopping Carts

我们两清 提交于 2019-12-07 14:35:50
问题 I've been looking into Varnish recently and doing some heavy Google searching. We've recently set this up in anticipation for Christmas on our server that runs an ecommerce site. We'll be having increased return visits over the next few weeks, so using Varnish seemed like a good idea. I was wondering if someone could clarify something for me - when using Varnish, if a user arrives for the first time it detects a new cookie (as sessions are used for the shopping cart) and caches the pages they

Change Listen Port on httpd config for Varnish Configuration

夙愿已清 提交于 2019-12-06 16:14:52
I installed Varnish Cache my CentOS server.I try the do configuration correctly but as I read many document say to me change apache port Listen 80 to Listen 8080 . But I couldn't find any Listen 80 line on my server /etc/httpd/conf/httpd.conf but i found 0.0.0.0:80 line. Is it same thing ? If those are same thinhgs, when i change my sites not working. I know that I make huge logical mistake but i can't understand. Thanks In this file /etc/httpd/conf/httpd.conf there should be a line: ServerRoot "/etc/httpd" Below this line there is Listen 80 Change this to Listen 8080 and restart apache

Varnish to be used for https

南楼画角 提交于 2019-12-06 14:40:53
Here's the situation. I have clients over a secured network (https) that talk to multiple backends. Now, I wanted to establish a reverse proxy for majorly load balancing (based on header data or cookies) and a little caching. So, I thought varnish could be of use. But, varnish does not support ssl-connection. As I've read at many places, quoting, "Varnish does not support SSL termination natively" . But, I want every connection, ie. client-varnish and varnish-backend to be over https. I cannot have plaintext data anywhere throughout network (there are restrictions) so nothing else can be used

Stale-while-revalidate cache replacement from Varnish

梦想与她 提交于 2019-12-06 13:42:31
We are currently moving our servers to a new one, with PLESK 12.5 which doesn't support Varnish cache for our PHP applications. We use Varnish, mostly for the 'stale-while-revalidate' capability, so that we can send whole pages or parts (using ESI) without any waiting time for any customer while cache is refreshing. Is there any alternative to Varnish for a similar kind of cache ? Either another "program" that could run on PLESK, or any PHP/server cache ? PLESK comes with NGINX, but it does not seem to provide 'stale-while-revalidate' capabilities ; I also know Squid isn't supported on PLESK.

Using Xdebug when the php application sits behind Varnish

爱⌒轻易说出口 提交于 2019-12-06 08:06:53
问题 I'm trying to set up Xdebug remote debugging to a site sitting behind Varnish as a caching layer using PHPStorm. Varnish is sitting as a frontend on port 80 with Apache talking to it as a backend on port 8080. If I bypass Varnish and talk directly to the site on port 8080 Xdebug and Phpstorm work as expected, however then I'm not really testing the system properly - what I really need to do is trigger a debug session even when the request is proxied through Varnish. Obviously I'm not

Tricking a Rails App to think it's on a different port

橙三吉。 提交于 2019-12-06 04:45:24
问题 I have a Rails app that is running on port 8080 that I need to trick to think it's running on port 80. I am running Varnish on port 80 and forwarding requests to nginx on port 8080 , but when the user tries to login with OmniAuth and the Devise gem generates a url to redirect back to the server, it thinks its on port 8080 which then the user will see. Is there any way to trick the Rails app to hard code the port as 80 (I would think it's a bad practice), or have nginx forward the request as