Giter Club home page Giter Club logo

alphagov.govuk-cdn-config's Introduction

GOV.UK CDN config

Configuration for GOV.UK's content delivery network (CDN). You can read more about how GOV.UK CDN works in the developer docs.

ℹī¸ This repo has some documented tech debt. It doesn't conform to GOV.UK standards, and lacks sufficient testing (especially for the bouncer and dictionary deploy scripts). Be sure to perform manual testing after making changes to the code.

Tasks

This repo contains 3 scripts to configure our Fastly CDN account.

Deploy Service

Script: deploy-service.sh

Invoked via the CDN: deploy service Jenkins job.

This script allows you to configure a number of Fastly services:

service name domain description
apt apt.publishing.service.gov.uk GOV.UK's Debian package repository
assets assets.publishing.service.gov.uk the GOV.UK domain for uploads and static assets
performanceplatform www.performance.service.gov.uk the Performance Platform (https://www.gov.uk/performance)
servicegovuk service.gov.uk redirect from https://service.gov.uk to https://www.gov.uk
tldredirect gov.uk redirect from https://gov.uk to https://www.gov.uk
www www.gov.uk the single government domain

Deploy Dictionaries

Script: deploy-dictionaries.sh

Invoked via the CDN: update dictionaries Jenkins job.

Fastly provide a technology called Edge Dictionaries which can be used to provide dynamic configuration to VCL. This script takes updates dictionaries defined in YAML files in configs/dictionaries. We use it for A/B testing and blocking IP addresses (the dictionary for this lives in alphagov/govuk-cdn-config-secrets - read more about IP banning in the docs).

Deploy Bouncer

Script: deploy-bouncer.sh

Invoked via the CDN: deploy Bouncer configs Jenkins job.

This configures the bouncer Fastly service with transitioned domains from Transition (read about Transition here). The Jenkins job is not usually run manually - it's triggered by the one of the transition Jenkins jobs. Read more about the Fastly service in the developer docs.

Making changes to VCL

You will need to re-generate the spec files when making changes to www.vcl.erb.

REGENERATE_EXPECTATIONS=1 bundle exec rspec

A/B testing

We use edge dictionaries to define the configuration for A/B and multivariate tests. The same configuration applies to A/B and multivariate tests, differing only on the number of variants.

  • configs/dictionaries/active_ab_tests.yaml: This controls whether the test is active or not. You may want to configure your test to be inactive at first, so that you can activate it at a later date.
  • configs/dictionaries/<test name lowercase>_percentages.yaml: The percentage of users who should see the variants of your test. This can be changed at a later date to expand the test to more users, but note that there will be some lag because users who have already visited the site will stay in their variant test buckets until their cookie expires. (See example_percentages.yaml).
  • configs/dictionaries/ab_test_expiries.yaml: The lifetime of the A/B test cookie. The value you choose depends on what kind of change you are making. If it is important that users always see a consistent version of the site (e.g. because you are making large changes to the navigation) then choose a lifetime which is significantly longer than the duration of your A/B test, such as 1 year. On the other hand, a shorter lifetime (such as 1 day) causes less lag when changing the B percentage, and might be more appropriate when testing something where consistency is less important from day-to-day, such as changing the order of search results.

Licence

MIT License

alphagov.govuk-cdn-config's People

Contributors

tijmenb avatar sihugh avatar barrucadu avatar dcarley avatar hannako avatar alexmuller avatar bilbof avatar fredericfran-gds avatar thomasleese avatar carvil avatar suzannehamilton avatar ajlanghorn avatar steventux avatar kevindew avatar timblair avatar mattbostock avatar brenetic avatar boffbowsh avatar afda16 avatar cbaines avatar deanwilson avatar erino avatar rtrinque avatar leenagupte avatar chrisbashton avatar rubenarakelyan avatar kr8n3r avatar peteleaman avatar emmabeynon avatar sengi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.