Choosing a CDN Provider for Promofama — Zur Rose Group

Alvaro P
Tech at PromoFarma by DocMorris
4 min readNov 20, 2019

Why a CDN provider?

Every CDN moves content closer to the user in order to reduce latency and improve the user experience.

It may look expensive at first, but the reality is that speed means money in this IT world, so it eventually will pay off, let’ s see check the main reasons:

Some of the benefits of using a CDN for your website include:

  • Faster load times for web and mobile users
  • Quickly scalable during times of heavy traffic
  • Minimizes risk of traffic spikes at point of origin, ensuring site stability
  • Decreases infrastructure costs due to traffic offloading (less load on origin)
  • Better site performance.
  • Better Security.

Why Fastly?

  • It ‘s fancy!!!
  • You guessed it!! It ‘s really fast.
  • It is very customizable and adaptable. We can upload our Custom VCL so we really can do almost anything, we only have to be careful at following good practices.
  • Terraform Friendly , for us all the infra must be coded!!
  • Powerful API, actually their backoffice is using the API itself.
  • Real Time Logs.

Many Powerful Features:

1- Image Management: Fastly Image Optimizer allows you to offload image transformation to our powerful edge cloud platform. When an image is requested, we resize it, adjust quality, crop / trim, change orientations, convert formats, and more on demand. Transforming images at the edge eliminates latency by reducing the number of requests back to origin.

Fastly also serves images faster, decreasing page load times for image-heavy sites. It will serve millions of variations of images from cache.

Instead of wasting our expensive AWS Resources in doing that work we can have Fastly to do it for us in more efficient manner so we skip software maintenance and Hardware Resources.

2- Security:

Fastly can provide us with state of the art WAF, so we end up with two layers of security defense : First layer just at the beginning of the client request -> With Fastly and the second one with AWS WAF.

Fastly WAF: Fastly’s cloud-based WAF consumes third-party rules from the OWASP Core Ruleset, commercial sources, and open source, in addition to Fastly own generated rules.

These Days DDoS are not uncommon so having Fastlty as a DDoS prevention is reassuringly: Fastly’s high-bandwidth, globally distributed network is built to absorb DDoS attacks.

Shield: We now are able to allow only access to our backend servers from the Fastly Network.

Though we have not implemented yet, we are evaluating Antibot Systems, and thus Fastly has lots of integrations with many Providers so it’s almost Plug&Play.

3- Fast Purge: the ability to purge all content in milliseconds is really a powerful feature allowing you to cache almost everything. You can even build cache purge into your application logic.

So imagine you have content that is updated frequently, let’ s say minutes, with other technologies this will mean the content is not cacheable, with Fastly you can cache forever and trigger purge whenever the data is modified.

4- Soft Purge: It allows you to mark content as outdated or slightly stale, instead of permanently removing it from cache. This ensures good user experiences even if your origin server goes down or takes longer than usual to update.

Instead of showing an error message, you can configure your content to serve stale-if-error or stale-while-revalidate. With stale-while-revalidate, the first person requesting a page after purging receives slightly outdated content, while your page is being refreshed in the background.

5- Surrogate Keys: Surrogate keys

Many websites are made of millions of interrelated objects, making it challenging to update all related content. Fastly surrogate keys allow you to fine-tune purging by tagging related objects across your site with a key name and description and purge by that key.

6- Wide Network: https://www.fastly.com/network-map

7- Authentication at the Edge:

Almost all authentication solutions these customers use can be built from a combination of four basic patterns:

Edge auth: Direct authentication against a credential database stored at the edge

Tokens: Reading, writing and validating signed tokens to persist an authentication state

Preflight: Sending a request to one backend for authentication prior to sending to another for the content

Redirect: Redirecting the user to a third party or other out-of-band service, and expecting to get them back later with some kind of token.

To sum up:

Having a partner like Fastly that provides performance enhancements, security layers and other features, helps us as a company to focus on the items we really add value, without sacrificing those important areas.

--

--