Original Authority
Original Authority
CDCloudflare Developers
Created by Original Authority on 9/24/2023 in #workers-help
Worker doesn't seem to be caching
Understood; but it seems a bit odd that it’s being evicted after every refresh?
3 replies
CDCloudflare Developers
Created by Original Authority on 9/6/2023 in #workers-help
How to deploy worker?
(that's probably a bad example as a crawler)
9 replies
CDCloudflare Developers
Created by Original Authority on 9/6/2023 in #workers-help
How to deploy worker?
doesn't seem to throw any erorrs https://pastebin.com/XRSWCSMg
9 replies
CDCloudflare Developers
Created by Original Authority on 9/6/2023 in #workers-help
How to deploy worker?
(No, it was not generated by CGPT). That didn't seem to work, I'll have a look at converting it.
9 replies
CDCloudflare Developers
Created by Original Authority on 9/6/2023 in #workers-help
How to deploy worker?
Ah, I was checking the browser console, wasn't sure where it logged 😮 Thanks for pointing that out, would here be an appropriate place to put it?
// process requests coming through
async function processRequest(originalRequest, event) {

// prepare
let {request, mobileAction, isMobile} = prepareRequest(originalRequest);
let url = new URL(request.url)


// only target pages
if ( url.pathname == '/' || (url.pathname).startsWith('/wiki/') || url.pathname == '/index.php' ) {
event.respondWith(processRequest(request, event));
}


// check if we should bypass, and why?
let {status, bypassCache} = shouldBypass(request);
// more.....
// process requests coming through
async function processRequest(originalRequest, event) {

// prepare
let {request, mobileAction, isMobile} = prepareRequest(originalRequest);
let url = new URL(request.url)


// only target pages
if ( url.pathname == '/' || (url.pathname).startsWith('/wiki/') || url.pathname == '/index.php' ) {
event.respondWith(processRequest(request, event));
}


// check if we should bypass, and why?
let {status, bypassCache} = shouldBypass(request);
// more.....
9 replies