Can someone please point me in the right direction for this? Keep in mind I’ve never used Fastly before. Never used VCL before, etc. However as a software engineer I’m well acquainted with HTTP and how it works.
Here are my requirements:
I need to setup a fastly endpoint that will accept GET requests and always return “200 OK” as quickly as possible, with no body whatsoever. The sole purpose of the endpoint is to track users. The plan is to:
a) never allow intermediate hosts to cache the response
b) every time fastly gets a request, it will always send a syslog containing the query string and all of the request headers to our syslog server.
c) syslogs will be formatted as json. This seems appropriate: https://github.com/fastly/vcl-json-generate
Since we are never returning any content to the client, whether fastly “caches” the empty response is of no consequence, as long as it meets the requirements above (intermediate hosts never cache, browser never caches, and every fastly hit results in a syslog message sent to our syslog server).
(I’m aware that it probably sounds silly to use Fastly at all for this. However I didn’t design it, I’m only implementing it.)
a) using vcl_log is a great idea, since it allows us to return a response to the client before sending the syslog (quick response is one of the goals). Since I’m going to use vcl-json-generate in “vcl_log”, I will need to upload custom VCL, is this correct?
b) is “vcl_log” called after every request, regardless of cache status?
c) no origin server is necessary. Is it even possible to set up a Fastly endpoint with no origin server?
Can you please point me in the right direction?
Please sign in to leave a comment.