Hacker News new | past | comments | ask | show | jobs | submit login

Yeah, especially your landing page. My site is a mix of Rails and static generators, but I scrape the Rails pages with wget --recursive, and then upload everything to S3, and put it all behind CloudFlare. You can put your Rails app behind CloudFlare too, but this way your site will never, ever go down.




How do you handle things like form submits? How do you mix rails and static files? Using Nginx?


My sign up page includes Recaptcha and requires a valid Stripe card token, so I can keep that static without worrying about CSRF. However, the sign in page is loaded from the Rails app server, and includes a CSRF token. The form submits all go to the Rails app server, which is running on a subdomain.

I run a rake task to scrape all of the landing page content from the Rails app, then copy in the static docs site, and upload everything to S3. So it's like I'm using Rails as a static site generator.

Basically my root domain is all static files, served from S3 / Cloudflare. And the Rails server is running on an "app" subdomain. I think it's been working pretty well. In the future I might make the whole app static, and just use Rails as an API.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: