Thanks again.Thanks for replying.So it seems to me that it's better to let Apache / nginx handle static files and and put Go handling just the dynamic pages.
2014/1/17 Dmitry Vyukov <dvy...@google.com>
--
These are just off the top of my head.
At a pure performance level, I would imagine a Go webserver could be faster, since it wouldn't have all the configurable goodness I've described above. But both Apache and Nginx are written in C, so they aren't being slowed down by the language: if you were to write a functionally identical webserver in Go, I don't imagine it would be faster.
If performance is an issue, benchmark Apache, Nginx and a bare-bones Go server. I'd love to know your results, but put benchmarks on the web with extreme caution: you'll likely be accused of all sorts of inaccuracies and mistakes ;-) !
All the best,C
--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/moCDscfIc9E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
For caching you could also use CloudFlare, CloudFront or Google's Page Speed service. These services would be better than rolling your own reverse proxy.
As for logging a systemd init system makes logging a whole lot easier than it used to be. You could wrap https HandleFunc and just log.Println. (probably also want to disable logging timestamps) The OS would handle the rest.
You don't really decide: as go performs well over http, you don't need fastcgi, just put a reverse caching proxy before it - if and when you need it.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
location / {proxy_redirect off;# Security headers removed, but think about X-Frame-Options, Content-Security-Policy, etc# Enable HTTP keep-alivesproxy_http_version 1.1;proxy_set_header Connection "";# Buffers# Buffers should be greater than the mean response size to allow effective cachingproxy_buffering on;proxy_buffers 32 16k;proxy_buffer_size 32k;proxy_busy_buffers_size 64k;proxy_temp_file_write_size 64k;# Caching# Note that routes with Set-Cookie will not be cached so we do not need to be specific hereadd_header Cache-Control "max-age=0, private, must-revalidate";proxy_cache cache_name;proxy_cache_key "$scheme$host$request_uri";proxy_cache_valid 200 302 303 30s;proxy_cache_valid 404 30s;proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;add_header X-Cache $upstream_cache_status;# Pass scheme and remote host IP to proxied applicationproxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Scheme $scheme;proxy_set_header Referer $http_referer;proxy_set_header Host $http_host;}