You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.
When I'm looking at my site and https://example.com/foo/bar.html isn't working as expected, I first need to make sure the Markdown is alright. Normally this involves reading the fstab.yaml, then calling word2md, and a bunch of other stuff. Wouldn't it be great if I could just use https://example.com/foo/bar.md to get the Markdown representation?
Yes, it would be great. We could just use the helix-content-proxy and a new Request-Type: Content to serve the markdown.
Then Helix-Pipeline could use this URL to fetch the raw Markdown content: adobe/helix-pipeline#734
Challenges
helix-content-proxy expects (but doesn't enforce yet) absolute refs (shas) to keep content in the cache forever
our VCL only has symbolic branch names (like master) and resolution only happens in helix-dispatch
I see two ways to deal with this:
Approach A: serve it anyway, but with inconvenient caches
we call helix-content-proxy, which will never enforce shas
we serve content that might be slightly out of date to begin with (due to raw.githubusercontent.com's built-in caching that resolve-git-ref would normally circumvent)
the MD file is served with a cache lifetime that will be too short for the cache to be effective and too long to be convenient for the developer
Approach B: serve a redirect, to an inconvenient URL
given a symbolic name, we call helix-resolve-git-ref and return the result as a 302 temporary redirect to the same file, this time including the correct ref as a URL parameter
the redirect remains uncached (potentially slow)
given an absolute ref, either from the strain or through the ref URL parameter, we call helix-content-proxy and serve with a long cache timeline
helix-pipeline will append the ?ref=… parameter to the URL when fetching (it is always being called with a pre-resolved ref), so that no additional lookup is needed
So our developer would take https://example.com/foo/bar.html, change the html to md in the browser, hit return and get https://example.com/foo/bar.md?ref= 0b4cd12233ba3d3585b7270c63aec3b494fb0202 . Upon making changes in the repo, the developer would need to remove the ref= parameter before reloading.
Approach C: the best (or worst) of both worlds
We use Approach A when dealing with browsers and Approach B when dealing with helix-fetch and other API clients (they'd use a header like helix-redirect: please).
The text was updated successfully, but these errors were encountered:
Paraphrasing @davidnuescheler:
Yes, it would be great. We could just use the
helix-content-proxy
and a newRequest-Type: Content
to serve the markdown.Then Helix-Pipeline could use this URL to fetch the raw Markdown content: adobe/helix-pipeline#734
Challenges
helix-content-proxy
expects (but doesn't enforce yet) absolute refs (shas) to keep content in the cache forevermaster
) and resolution only happens inhelix-dispatch
I see two ways to deal with this:
Approach A: serve it anyway, but with inconvenient caches
helix-content-proxy
, which will never enforce shasresolve-git-ref
would normally circumvent).md
URL will be unusable forhelix-pipeline
Fetch Markdown from Helix Content Proxy helix-pipeline#734Approach B: serve a redirect, to an inconvenient URL
helix-resolve-git-ref
and return the result as a 302 temporary redirect to the same file, this time including the correctref
as a URL parameterref
URL parameter, we callhelix-content-proxy
and serve with a long cache timelinehelix-pipeline
will append the?ref=…
parameter to the URL when fetching (it is always being called with a pre-resolved ref), so that no additional lookup is neededSo our developer would take
https://example.com/foo/bar.html
, change thehtml
tomd
in the browser, hit return and gethttps://example.com/foo/bar.md?ref= 0b4cd12233ba3d3585b7270c63aec3b494fb0202
. Upon making changes in the repo, the developer would need to remove theref=
parameter before reloading.Approach C: the best (or worst) of both worlds
We use Approach A when dealing with browsers and Approach B when dealing with
helix-fetch
and other API clients (they'd use a header likehelix-redirect: please
).The text was updated successfully, but these errors were encountered: