LogoLogo
  • Planet 4
  • Development
    • Contribute
    • Installation
    • Git Guidelines
    • Coding Standards
    • Continuous Delivery
  • CI/CD
    • Test Instances
    • Deployment
    • Testing
      • End-to-end Tests
      • Visual Regression Tests
  • NRO Customization
    • Development
      • Using Child Themes
      • Package Registry
      • Plugins
    • Testing
      • Visual Regression Tests
    • Deployment
      • Production
      • DB/Media Sync
  • Infrastructure
    • NRO Generation
    • ElasticSearch
    • Cloudflare
  • Recipes
    • Maintenance page
    • Production sync
    • Running commands
  • Platform
    • Practices
    • ADRs
      • [ADR-0001] Use Gitbook for Technical Documentation
      • [ADR-0002] P3 Archive elastic search integration
      • [ADR-0003] WYSIWYG Blocks Architecture
      • [ADR-0004] Switch to Monorepo
      • [ADR-0006] Define scope for deployment environments
      • [ADR-0008] PSR-4 Autoloading Standard
      • [ADR-0009] Include Media Library in master theme
      • [ADR-0011] PHP Coding Standards
      • [ADR-0012] Use custom SCSS syntax for variables
      • [ADR-0013] Choose a ticketing system
      • [ADR-0014] Choose a testing framework
      • [ADR-0015] Use block templates to build block patterns
      • [ADR-0016] Form Builder data retention policy
      • [ADR-0017] Move blocks into the theme
    • Changelog
      • 2024
      • 2023
      • 2022
      • 2021
      • 2020
      • 2019
      • 2018
  • Tech
    • Wordpress
    • Blocks
    • Plugins
    • Hooks
    • Data migrations
    • CSS variables
Powered by GitBook
On this page
  • Configuration
  • Workers
  • Static files
  • Robots
  • Homepage
Edit on GitHub
  1. Infrastructure

Cloudflare

Our CDN piece of infrastructure, tunneling all traffic to P4 websites

PreviousElasticSearchNextMaintenance page

Last updated 5 months ago

Configuration

All the permanent settings in are managed by code () and deployed through GitLab CI.

Any change to our Cloudflare assets and their respective configuration should happen through .

Workers

We are using a few for applying certain functionality on specific routes/urls. The workers deployment is also managed in code and deployed by CircleCI.

Static files

This is responsible for proxying 4 static files (practically anything from the Media Library) from GCP buckets. The worker in practice does the following things:

  • Masks default GCP url (storage.googleapis.com) with one of our own (www.greenpeace.org/static/) branding reasons.

  • Using our own domain, also allow us to use Cloudflare's feature for optimizing images, since it can ony be applied in a domain we own.

  • Since the files are now served from our domain they are also cached by Cloudflare in its edge servers, which are closer to end user location.

  • We also have the option to adjust headers if needed. Currently we decrease browser cache for pdf files to ensure end users don't get an older version when a file is replaced with a new one.

Robots

This is responsible for rendering a robots.txt file to ensure dev and staging are not indexed by search engines.

Homepage

This is responsible for rendering the Planet 4 .

Cloudflare
Terraform
code
Cloudflare workers
worker
Polish
worker
worker
homepage