Maik Klein
Maik Klein

Reputation: 16148

Caching cdn service for static content?

I am starting to publish my first website. I have an idea and I am curious if there is such a service.

For example I have a newspage and I always cache it if it changes. Now I am curious if there is a service which scans my site for changed static content.

This way my visitors would hit the cdn server instead of my server. The idea is to get load of my heroku server so I have to use less dynos -> less money.

I now that this won't apply to all of my content like specific user generated content.

I know that Cloudflare is doing something similar but they only scan the whole site every 4 hours.

http://postimage.org/image/j7jscj88l/

Upvotes: 2

Views: 4628

Answers (3)

Kostia
Kostia

Reputation: 6304

You should look into using cloudflare as a CDN for static content. It is free with unlimited traffic, and has a lot of additional features like added security, google analytics integration, etc.

Also, if you are using heroku, your html is cached by heroku's varnish cache. This is automatic; all you have to do is set a valid expires header for varnish to recongnize. You can read more about Heroku's varnish setup here.

Upvotes: 4

AccuWebHosting.Com
AccuWebHosting.Com

Reputation: 1159

It all depends on your CDN hosting company. My CDN provider is flushing content every 60 minutes. That means, If on a particular node, there is no visitor for xyz.jpg in 60 minutes, that file is flushed from that node.

If I have a small website (using less than 10 GB a Month), I will concentrate on a CDN provider having Maximum number of Nodes on CDN Network.

If I have a large website (using 100s of GIGs every month), I will concentrate cost factor rather than total number of Nodes.

Upvotes: 2

Mike Brant
Mike Brant

Reputation: 71384

Pretty much most major CDN's offer source origin pull, to allow the CDN to pull content from an origin server of your choice. There are some free CDN services out there like CoralCDN, but in my experience the performance is spotty. And at the end of the day, most people look to use CDN's for performance purposes rather than for cost savings (top CDN networks are not cheap).

Upvotes: 1

Related Questions