1

I have 8 servers caching content from an API, the issue is keeping them at sync.

So i was wondering the same way we can http PURGE via curl, can i do the same to call each cache server and make it cache a specific url?

i tried doing it using curl and testing with postman at the same time, but seems to see it as different requests.

All help is much appreciated!

Bruno
  • 11
  • 2
  • Please post how you run curl and your VCL. – Danila Vershinin Mar 27 '17 at 09:23
  • Hi Daniel,Im using : curl --verbose --header 'Host:' 'http:///api/blockbuster/menu' – Bruno Mar 28 '17 at 12:42
  • If you cannot post complete VCL, you can at least post your ```vcl_hash```. This is likely where the culprit is. – Danila Vershinin Mar 28 '17 at 15:17
  • vcl 4.0; backend default {.host = "xxx.xx.xxx.xx";.port = "80";} backend CMS_prod { .host = "xx.xx.xx.xx"; .port = "80"; .first_byte_timeout = 300s; } – Bruno Mar 28 '17 at 18:32
  • sub vcl_recv { if (req.http.host == "") { #You will need the following line only if your backend has multiple virtual host names set req.backend_hint = CMS_prod; if (req.url ~ "availability=now") { return (pass); }else{ return (hash); } return (hash); } } – Bruno Mar 28 '17 at 18:34
  • sub vcl_backend_response { # Happens after we have read the response headers from the backend. # # Here you clean the response headers, removing silly Set-Cookie headers # and other mistakes your backend does. if (bereq.url ~ "/api/") { unset beresp.http.set-cookie; unset beresp.http.cookie; set beresp.do_gzip = true; set beresp.ttl = 36h; } set beresp.ttl = 36h; set beresp.grace = 36h; return (deliver); } – Bruno Mar 28 '17 at 18:35
  • sub vcl_deliver { # Happens when we have all the pieces we need, and are about to send the # response to the client. # # You can do accounting or modifying the final object here. unset resp.http.Via; #unset resp.http.X-Varnish; unset resp.http.Server; } sub vcl_backend_error { set beresp.http.Content-Type = "text/html; charset=utf-8"; synthetic( {"errors due to backend fetch"} ); return (deliver); } – Bruno Mar 28 '17 at 18:36
  • Sorry i don't know how to upload files to here, but i don't have a VCL_hash either :-( – Bruno Mar 28 '17 at 18:36

0 Answers0