Hi Team,
We’re working on building a Proof of Concept (POC) before fully implementing WeWeb’s recommendations on metadata for dynamic pages using a Cloudflare Worker. We’re facing an issue where, although the metadata is correctly returned in the worker logs, the HTML isn’t being updated, and the page is not rendering as expected.
Here are a few questions we have:
- Domain Configuration for WeWeb Project: Given that the worker should act as the entry point for at least some pages, what should the domain configuration look like for the WeWeb project?
- Cloudflare Worker and DNS Conflict: How should the domain configuration be set up in Cloudflare Workers to avoid conflicts with the DNS configuration for the project in WeWeb?
Any guidance or insights on resolving this would be greatly appreciated. @Slavo @flo
Config file:
export const config = {
domainSource: "https://5a01a34e-e669-4654-9a30-49e0ca703474.weweb-preview.io/", // Your WeWeb app preview link
patterns: [
{
pattern: "/blog/[^/]+",
metaDataEndpoint: "https://xqwg-7kxp-yoks.n7.xano.io/api:3DvLmlut/blogs/%7Bid%7D/metadata?blog_id={id}"
}
// Add more patterns and their metadata endpoints as needed
]
};
Worker Log:
{
"truncated": false,
"outcome": "ok",
"scriptVersion": {
"id": "08f3df7d-ab8a-4c71-8232-f17e242719ac"
},
"scriptName": "weweb-dynamic-metadata",
"diagnosticsChannelEvents": [],
"exceptions": [],
"logs": [
{
"message": [
"Worker started"
],
"level": "log",
"timestamp": 1727199093862
},
{
"message": [
"Dynamic page detected:",
"/blog/3"
],
"level": "log",
"timestamp": 1727199093862
},
{
"message": [
"Metadata fetched:",
{
"title": "pinenut olive waterchestnut plantain elephantapple",
"image_url": "https://cdn.weweb.io/designs/cb1a32d4-b349-4382-8560-8c5d5445ec2d/sections/Dog.png?_wwcv=1697118386904",
"description": "A little article"
}
],
"level": "log",
"timestamp": 1727199094766
}
],
"eventTimestamp": 1727199093862,
"event": {
"request": {
"url": "https://www.madeeasy.ai/blog/3",
"method": "GET",
"headers": {
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"accept-encoding": "gzip, br",
"accept-language": "pt-BR,pt;q=0.9",
"cf-connecting-ip": "213.22.208.236",
"cf-ipcountry": "PT",
"cf-ray": "8c84824098c6cbc6",
"cf-visitor": "{\"scheme\":\"https\"}",
"connection": "Keep-Alive",
"cookie": "REDACTED",
"host": "www.madeeasy.ai",
"priority": "u=0, i",
"sec-ch-ua": "\"Not/A)Brand\";v=\"8\", \"Chromium\";v=\"126\", \"Google Chrome\";v=\"126\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"sec-fetch-dest": "document",
"sec-fetch-mode": "navigate",
"sec-fetch-site": "none",
"sec-fetch-user": "?1",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
"x-forwarded-proto": "https",
"x-real-ip": "213.22.208.236"
},
"cf": {
"longitude": "-8.61680",
"httpProtocol": "HTTP/3",
"tlsCipher": "AEAD-AES128-GCM-SHA256",
"continent": "EU",
"asn": 2860,
"clientAcceptEncoding": "gzip, deflate, br, zstd",
"tlsClientExtensionsSha1": "qCr5eNto1qTeRgR7iGZC09X3TKQ=",
"isEUCountry": "1",
"verifiedBotCategory": "",
"tlsClientAuth": {
"certIssuerDNLegacy": "",
"certIssuerSKI": "",
"certSubjectDNRFC2253": "",
"certSubjectDNLegacy": "",
"certFingerprintSHA256": "",
"certNotBefore": "",
"certSKI": "",
"certSerial": "",
"certIssuerDN": "",
"certVerified": "NONE",
"certNotAfter": "",
"certSubjectDN": "",
"certPresented": "0",
"certRevoked": "0",
"certIssuerSerial": "",
"certIssuerDNRFC2253": "",
"certFingerprintSHA1": ""
},
"tlsExportedAuthenticator": {
"clientFinished": "ac2d56017a5001e618025964cf3692a53b44eae67183dc1476d03bc83023aefc",
"clientHandshake": "20db14ccb5bb81a15cc7b606415439a94a3de9191999db44b1ebde04e039747a",
"serverHandshake": "7472f20901e5debe9e7235a377cd857f035d01c788d885eb5adcc49cb6f5ac4c",
"serverFinished": "5a52f06ae1c70d181a8f7680d4c3c8b66490cfa6cade091b38c674cbf221c442"
},
"tlsVersion": "TLSv1.3",
"city": "Vila Nova de Gaia",
"timezone": "Europe/Lisbon",
"tlsClientHelloLength": "1766",
"requestPriority": "",
"edgeRequestKeepAliveStatus": 1,
"tlsClientRandom": "oytlCkRTelSgHRFy/FgrHbfqwcYzZfqhGr29p3KnNkg=",
"region": "Porto",
"latitude": "41.13840",
"postalCode": "4430-441",
"regionCode": "13",
"asOrganization": "Nos Comunicacoes",
"colo": "MAD",
"country": "PT"
}
},
"response": {
"status": 200
}
},
"id": 24
}
Cloudflare worker settings:
URL example (not working)