[{"data":1,"prerenderedAt":356},["ShallowReactive",2],{"docs-\u002Fapi-proxy-overview":3},{"id":4,"title":5,"body":6,"description":348,"extension":349,"meta":350,"navigation":351,"path":352,"seo":353,"stem":354,"__hash__":355},"docs\u002Fdocs\u002Fapi-proxy-overview.md","API Proxy Overview",{"type":7,"value":8,"toc":331},"minimark",[9,13,17,38,41,44,49,52,73,76,78,82,86,89,104,111,115,118,134,137,139,143,146,156,159,170,172,176,180,183,203,206,209,212,222,225,227,231,234,251,254,256,260,263,274,277,291,293,297],[10,11,5],"h1",{"id":12},"api-proxy-overview",[14,15,16],"p",{},"Cachely supports two complementary proxy layers on the same project:",[18,19,20,28],"ul",{},[21,22,23,27],"li",{},[24,25,26],"strong",{},"Asset proxy"," for media delivery and edge caching",[21,29,30,33,34],{},[24,31,32],{},"API proxy"," for read-only CMS API requests through ",[35,36,37],"code",{},"your-project.cmsassets.com\u002F~api",[14,39,40],{},"The recommended setup uses both: route read-only CMS API requests through the API proxy, keep tokens server-side, cache responses at the edge, and return proxy-ready asset URLs automatically. Asset-only usage is the lighter alternative for when you only need media delivery.",[42,43],"hr",{},[45,46,48],"h2",{"id":47},"recommended-setup","Recommended setup",[14,50,51],{},"The strongest Cachely setup is:",[53,54,55,61,64,67],"ol",{},[21,56,57,58],{},"proxy read-only CMS API requests through ",[35,59,60],{},"https:\u002F\u002Fyour-project.cmsassets.com\u002F~api\u002F...",[21,62,63],{},"inject credentials server-side",[21,65,66],{},"cache API responses at the edge",[21,68,69,70],{},"rewrite asset URLs in JSON responses to ",[35,71,72],{},"https:\u002F\u002Fyour-project.cmsassets.com\u002F...",[14,74,75],{},"That gives your app a single proxy layer for both CMS data and asset delivery.",[42,77],{},[45,79,81],{"id":80},"asset-proxy-vs-api-proxy","Asset proxy vs API proxy",[83,84,32],"h3",{"id":85},"api-proxy",[14,87,88],{},"Use API proxy when you want to:",[18,90,91,96,99,101],{},[21,92,93,94],{},"route read-only CMS API requests through ",[35,95,60],{},[21,97,98],{},"keep CMS credentials server-side",[21,100,66],{},[21,102,103],{},"return proxy-ready asset URLs in JSON responses",[14,105,106,107,110],{},"API proxy is ",[35,108,109],{},"GET"," only. It is designed for fetching CMS content safely and efficiently, not for writes, uploads, deletes, or admin mutations.",[83,112,114],{"id":113},"asset-proxy-only","Asset proxy only",[14,116,117],{},"Use asset proxy on its own when you want to:",[18,119,120,125,128,131],{},[21,121,122,123],{},"serve CMS media through ",[35,124,72],{},[21,126,127],{},"cache images, files, and videos at the edge",[21,129,130],{},"reduce origin bandwidth and control overage costs",[21,132,133],{},"keep implementation as small as possible",[14,135,136],{},"This is the lighter path, but it does not replace the API proxy when you also want proxied CMS responses and server-side credential handling.",[42,138],{},[45,140,142],{"id":141},"one-edge-domain-for-both","One edge domain for both",[14,144,145],{},"The same project handles both flows:",[147,148,154],"pre",{"className":149,"code":151,"language":152,"meta":153},[150],"language-text","Asset request: https:\u002F\u002Fyour-project.cmsassets.com\u002Fpath\u002Fto\u002Fimage.jpg\nAPI request:   https:\u002F\u002Fyour-project.cmsassets.com\u002F~api\u002Fspaces\u002Fabc\u002Fentries\n","text","",[35,155,151],{"__ignoreMap":153},[14,157,158],{},"That means you can:",[53,160,161,164,167],{},[21,162,163],{},"create one project",[21,165,166],{},"use the API proxy by default",[21,168,169],{},"fall back to asset-only mode when you want less surface area",[42,171],{},[45,173,175],{"id":174},"common-rollout-paths","Common rollout paths",[83,177,179],{"id":178},"api-asset-proxy","API + asset proxy",[14,181,182],{},"Best when you want Cachely to handle the full delivery layer:",[18,184,185,188,193,200],{},[21,186,187],{},"create a project",[21,189,93,190],{},[35,191,192],{},"\u002F~api",[21,194,195,196,199],{},"configure ",[35,197,198],{},"apiOrigin",", auth mode, token header, and token",[21,201,202],{},"keep parsed responses enabled so asset URLs are already rewritten",[14,204,205],{},"This is the recommended path.",[83,207,114],{"id":208},"asset-proxy-only-1",[14,210,211],{},"Best when you want the smallest implementation step:",[18,213,214,216,219],{},[21,215,187],{},[21,217,218],{},"route asset URLs through your edge domain",[21,220,221],{},"keep your existing CMS API calls unchanged",[14,223,224],{},"This path works well with the CLI, response transformer, SDK, or a small URL rewrite step in your CMS client.",[42,226],{},[45,228,230],{"id":229},"parsed-vs-raw-api-responses","Parsed vs raw API responses",[14,232,233],{},"By default, Cachely can rewrite asset URLs inside JSON API responses so your app receives proxy-ready URLs.",[18,235,236,239,245],{},[21,237,238],{},"default behavior: parsed response with rewritten asset URLs",[21,240,241,244],{},[35,242,243],{},"?parsed=false",": raw proxied response without URL rewriting",[21,246,247,250],{},[35,248,249],{},"transformApiUrls=false",": disable JSON URL rewriting at the project level",[14,252,253],{},"This is useful when one consumer wants tenant URLs while another needs the raw upstream payload.",[42,255],{},[45,257,259],{"id":258},"when-asset-only-is-enough","When asset-only is enough",[14,261,262],{},"You can stay with asset-only mode when:",[18,264,265,268,271],{},[21,266,267],{},"your CMS API credentials are already handled elsewhere",[21,269,270],{},"you only need proxied media delivery",[21,272,273],{},"you want the smallest rollout possible",[14,275,276],{},"You should still use the API proxy when:",[18,278,279,282,285,288],{},[21,280,281],{},"your frontend should not see CMS tokens",[21,283,284],{},"you want edge caching for read-heavy CMS endpoints",[21,286,287],{},"you want asset URLs rewritten before the response reaches your app",[21,289,290],{},"you want one edge domain for both asset and API traffic",[42,292],{},[45,294,296],{"id":295},"next-steps","Next steps",[18,298,299,307,317,324],{},[21,300,301,306],{},[302,303,305],"a",{"href":304},"\u002Fdocs\u002Fgetting-started","Getting Started"," — Choose the right setup path",[21,308,309,313,314,316],{},[302,310,312],{"href":311},"\u002Fdocs\u002Fconfiguring-api-proxy","Configuring API Proxy"," — Set up ",[35,315,198],{},", token injection, and caching",[21,318,319,323],{},[302,320,322],{"href":321},"\u002Fdocs\u002Fhow-it-works","How It Works"," — See request flow and cache behavior",[21,325,326,330],{},[302,327,329],{"href":328},"\u002Fdocs\u002Fapi","Admin API"," — Reference for tenant and API proxy endpoints",{"title":153,"searchDepth":332,"depth":332,"links":333},2,[334,335,340,341,345,346,347],{"id":47,"depth":332,"text":48},{"id":80,"depth":332,"text":81,"children":336},[337,339],{"id":85,"depth":338,"text":32},3,{"id":113,"depth":338,"text":114},{"id":141,"depth":332,"text":142},{"id":174,"depth":332,"text":175,"children":342},[343,344],{"id":178,"depth":338,"text":179},{"id":208,"depth":338,"text":114},{"id":229,"depth":332,"text":230},{"id":258,"depth":332,"text":259},{"id":295,"depth":332,"text":296},"Understand the Cachely API proxy — how token injection, edge caching, and asset URL rewriting work together, and when to use asset-only mode instead.","md",{},true,"\u002Fdocs\u002Fapi-proxy-overview",{"title":5,"description":348},"docs\u002Fapi-proxy-overview","eCsO32rY_SQOQic_NPo2UhxZ4E4KqYHDlEwUr-6VLgw",1777579477591]