Giter Site home page Giter Site logo

helix-purge's Introduction

Helix Purge

Purge two CDNs at once

Status

codecov CircleCI GitHub license GitHub issues LGTM Code Quality Grade: JavaScript semantic-release

Installation

Usage

curl -X POST https://adobeioruntime.net/api/v1/web/helix/helix-services/purge@v1?host=…&xfh=…&path=…
  • host: the inner cdn hostname
  • xfh: the outer cdn hostnames, comma separated
  • path: the path to purge

For more, see the API documentation.

Development

Deploying Helix Purge

Deploying Helix Purge requires the wsk command line client, authenticated to a namespace of your choice. For Project Helix, we use the helix namespace.

All commits to master that pass the testing will be deployed automatically. All commits to branches that will pass the testing will get commited as /helix-services/purge@ci<num> and tagged with the CI build number.

Operations

To temporarily stop purges, edit OK.md, so that it says "not ok".

helix-purge's People

Contributors

adobe-bot avatar davidnuescheler avatar dominique-pfister avatar renovate-bot avatar renovate[bot] avatar rofe avatar semantic-release-bot avatar stefan-guggisberg avatar trieloff avatar tripodsan avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

helix-purge's Issues

Purging a non-existing URL should not fail

It would be great if helix-purge could be relaxed (or have a relax parameter) when purging URLs that 404, so ...

curl -X HLXPURGE https://theblog--adobe.hlx.page/en/2019/05/07/adobe-summit-emea-2019.html 
[{
  "status": "error",
  "url": "https://theblog--adobe.hlx.page/en/2019/05/07/adobe-summit-emea-2019.html"
}]

... would return the same status as ...

curl -X PURGE https://theblog--adobe.hlx.page/en/2019/05/07/adobe-summit-emea-2019.html 
{ "status": "ok", "id": "4026-1611233774-3941357" }

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Location: config
Error type: Invalid allowedVersions
Message: The following allowedVersions does not parse as a valid version or range: "<15>"

Directory and file purging logic

helix-purge should handle directories and files as follows:

Inner CDN:

  • Surrogate key purge
  • also content-proxy cache: https://${branch}--${repo}--${owner}.hlx.page/${pathPrefix}.md

Outer CDN:

  • /: directory, also purge /index and /index.html
  • /index: also purge / and '/index.html`
  • /index.html: also purge / and '/index`
  • /foo.html: also purge /foo
  • /foo: also purge /foo.html
  • /bar.json: only purge /bar.json

and report all purged URLs in the response.

cc @tripodsan @trieloff

No Universal Runtime Support

## Purge Flexy CSS
curl -X "HLXPURGE" "https://pages--adobe.hlx.live/styles/blocks/flexy.css?1"
HTTP/1.1 404 Not Found
Connection: close
Content-Length: 91
Content-Type: text/plain; charset=utf-8
Apigw-Requestid: akt1JgtdIAMEMGA=
X-Backend-Health: 1 1
Accept-Ranges: bytes
X-Version: 517; src=517; cli=8.4.6; rev=online
Content-Security-Policy: frame-ancestors 'self'
Via: 1.1 varnish, 1.1 varnish
Cache-Control: max-age=7200
Date: Thu, 11 Feb 2021 09:19:03 GMT
X-Served-By: cache-bwi5121-BWI, cache-ams21025-AMS
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1613035143.165249,VS0,VE183
Vary: X-Debug,X-Strain,X-Request-Type,X-Forwarded-Host,X-OW-Version-Lock, Accept-Encoding
Strict-Transport-Security: max-age=31557600
Function not found: arn:aws:lambda:us-east-1:118435662149:function:helix-services--purge:v1

archive-repository

  • update readme: > Note: this repository and respective service is no longer maintained (commit with [skip ci])
  • close all issues
  • close all PRs
  • disable status checks
  • close this issue and archive

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.


  • Check this box to trigger a request for Renovate to run again on this repository

emergency stop switch

in a situation where the inner CDN produces faulty output due to system wide issues, it would be great if there was an easy way to centrally suspend the purge service temporarily to avoid purges of functioning outer CDN caches and therefore propagating inner CDN issues to the outer CDNs.

i think the initial activation of the emergency stop switch possibly initially should be triggered by the person acknowledging the outage and we should describe the procedure in the on-call runbook.

Emergency stop switch: check plain html rendition

The "dead man switch" that blocks purging when something is wrong with Helix Pages currently checks the full rendition of OK.md against a static copy. This includes metadata tags with GH branches exposed in the URLs. This was the reason for a regression (see #50) and might cause further issues in the future.

Checking against a plain html rendition instead (/OK.plain.html) would be more streamlined, branch-safe and require less frequent updates of the static copy.

detect correct default branch

Description
when purging an url w/o branch, purge uses master as default which is wrong.
it should detect the default branch.

Surrogate key purging

#2 @rofe

Nice! But...

Try https://adobeioruntime.net/api/v1/web/helix/helix-services/purge@ci?host=theblog--adobe.hlx.page&xfh=blog.adobe.com&path=/en/2020/08/14/6-ways-ta-adapt-advance-your-business-during-pandemic.html

... obviously in the case of theblog it's not so simple, because the paths differ between inner and outer CDN... it would be cool if instead of the path parameter, one could alternatively specify a surrogate key. This way we could also use this service to bust all cached index json segments at once.

We could then create a "Purge cache" bookmarklet, similar to the "Preview" one, which calculates the surrogate key from the URL of the source document.

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.