[{"data":1,"prerenderedAt":770},["ShallowReactive",2],{"docs-\u002Fgeneric-origin":3},{"id":4,"title":5,"body":6,"description":763,"extension":764,"meta":765,"navigation":613,"path":766,"seo":767,"stem":768,"__hash__":769},"docs\u002Fdocs\u002Fgeneric-origin.md","Generic Origin Mode",{"type":7,"value":8,"toc":751},"minimark",[9,13,17,20,25,60,62,66,81,89,94,185,188,196,199,205,209,263,267,321,323,327,337,340,404,410,412,416,419,571,573,577,587,664,671,722,733,735,739,747],[10,11,5],"h1",{"id":12},"generic-origin-mode",[14,15,16],"p",{},"Cachely has built-in support for Prismic, Contentful, Sanity, Shopify, Cloudinary, and Imgix, but you can also proxy any HTTPS asset origin by providing a custom origin URL in your tenant configuration.",[18,19],"hr",{},[21,22,24],"h2",{"id":23},"use-cases","Use cases",[26,27,28,36,42,48,54],"ul",{},[29,30,31,35],"li",{},[32,33,34],"strong",{},"AWS S3"," — Proxy assets from S3 buckets without exposing bucket URLs",[29,37,38,41],{},[32,39,40],{},"Cloudflare R2"," — Add caching and bandwidth tracking on top of R2",[29,43,44,47],{},[32,45,46],{},"Google Cloud Storage"," — Route GCS-hosted media through Cachely",[29,49,50,53],{},[32,51,52],{},"Legacy CMS servers"," — Proxy assets from self-hosted CMS installations",[29,55,56,59],{},[32,57,58],{},"Any HTTPS origin"," — If it serves files over HTTPS, Cachely can proxy it",[18,61],{},[21,63,65],{"id":64},"tenant-configuration","Tenant configuration",[14,67,68,69,72,73,76,77,80],{},"Select ",[32,70,71],{},"Generic Origin"," as the CMS type when creating or editing a tenant in the admin dashboard. Enter the full HTTPS origin URL in the ",[32,74,75],{},"Origin URL"," field. If your videos are hosted on a separate origin, fill in the optional ",[32,78,79],{},"Video Origin URL"," field.",[14,82,83,84,88],{},"You can also create generic origin tenants via the API by sending the origin URL as the ",[85,86,87],"code",{},"originUrl"," field:",[90,91,93],"h3",{"id":92},"example-s3-bucket","Example: S3 bucket",[95,96,101],"pre",{"className":97,"code":98,"language":99,"meta":100,"style":100},"language-json shiki shiki-themes github-dark","{\n  \"slug\": \"my-project\",\n  \"cms\": \"generic\",\n  \"originUrl\": \"https:\u002F\u002Fmy-bucket.s3.amazonaws.com\",\n  \"websiteDomain\": \"my-site.com\",\n  \"cacheTTL\": 86400\n}\n","json","",[85,102,103,112,129,142,155,168,179],{"__ignoreMap":100},[104,105,108],"span",{"class":106,"line":107},"line",1,[104,109,111],{"class":110},"s95oV","{\n",[104,113,115,119,122,126],{"class":106,"line":114},2,[104,116,118],{"class":117},"sDLfK","  \"slug\"",[104,120,121],{"class":110},": ",[104,123,125],{"class":124},"sU2Wk","\"my-project\"",[104,127,128],{"class":110},",\n",[104,130,132,135,137,140],{"class":106,"line":131},3,[104,133,134],{"class":117},"  \"cms\"",[104,136,121],{"class":110},[104,138,139],{"class":124},"\"generic\"",[104,141,128],{"class":110},[104,143,145,148,150,153],{"class":106,"line":144},4,[104,146,147],{"class":117},"  \"originUrl\"",[104,149,121],{"class":110},[104,151,152],{"class":124},"\"https:\u002F\u002Fmy-bucket.s3.amazonaws.com\"",[104,154,128],{"class":110},[104,156,158,161,163,166],{"class":106,"line":157},5,[104,159,160],{"class":117},"  \"websiteDomain\"",[104,162,121],{"class":110},[104,164,165],{"class":124},"\"my-site.com\"",[104,167,128],{"class":110},[104,169,171,174,176],{"class":106,"line":170},6,[104,172,173],{"class":117},"  \"cacheTTL\"",[104,175,121],{"class":110},[104,177,178],{"class":117},"86400\n",[104,180,182],{"class":106,"line":181},7,[104,183,184],{"class":110},"}\n",[14,186,187],{},"With this configuration, a request to:",[95,189,194],{"className":190,"code":192,"language":193},[191],"language-text","https:\u002F\u002Fmy-project.cmsassets.com\u002Fimages\u002Fphoto.jpg\n","text",[85,195,192],{"__ignoreMap":100},[14,197,198],{},"Is proxied to:",[95,200,203],{"className":201,"code":202,"language":193},[191],"https:\u002F\u002Fmy-bucket.s3.amazonaws.com\u002Fimages\u002Fphoto.jpg\n",[85,204,202],{"__ignoreMap":100},[90,206,208],{"id":207},"example-cloudflare-r2","Example: Cloudflare R2",[95,210,212],{"className":97,"code":211,"language":99,"meta":100,"style":100},"{\n  \"slug\": \"my-r2\",\n  \"cms\": \"generic\",\n  \"originUrl\": \"https:\u002F\u002Fpub-abc123.r2.dev\",\n  \"cacheTTL\": 604800\n}\n",[85,213,214,218,229,239,250,259],{"__ignoreMap":100},[104,215,216],{"class":106,"line":107},[104,217,111],{"class":110},[104,219,220,222,224,227],{"class":106,"line":114},[104,221,118],{"class":117},[104,223,121],{"class":110},[104,225,226],{"class":124},"\"my-r2\"",[104,228,128],{"class":110},[104,230,231,233,235,237],{"class":106,"line":131},[104,232,134],{"class":117},[104,234,121],{"class":110},[104,236,139],{"class":124},[104,238,128],{"class":110},[104,240,241,243,245,248],{"class":106,"line":144},[104,242,147],{"class":117},[104,244,121],{"class":110},[104,246,247],{"class":124},"\"https:\u002F\u002Fpub-abc123.r2.dev\"",[104,249,128],{"class":110},[104,251,252,254,256],{"class":106,"line":157},[104,253,173],{"class":117},[104,255,121],{"class":110},[104,257,258],{"class":117},"604800\n",[104,260,261],{"class":106,"line":170},[104,262,184],{"class":110},[90,264,266],{"id":265},"example-google-cloud-storage","Example: Google Cloud Storage",[95,268,270],{"className":97,"code":269,"language":99,"meta":100,"style":100},"{\n  \"slug\": \"my-gcs\",\n  \"cms\": \"generic\",\n  \"originUrl\": \"https:\u002F\u002Fstorage.googleapis.com\u002Fmy-bucket\",\n  \"cacheTTL\": 172800\n}\n",[85,271,272,276,287,297,308,317],{"__ignoreMap":100},[104,273,274],{"class":106,"line":107},[104,275,111],{"class":110},[104,277,278,280,282,285],{"class":106,"line":114},[104,279,118],{"class":117},[104,281,121],{"class":110},[104,283,284],{"class":124},"\"my-gcs\"",[104,286,128],{"class":110},[104,288,289,291,293,295],{"class":106,"line":131},[104,290,134],{"class":117},[104,292,121],{"class":110},[104,294,139],{"class":124},[104,296,128],{"class":110},[104,298,299,301,303,306],{"class":106,"line":144},[104,300,147],{"class":117},[104,302,121],{"class":110},[104,304,305],{"class":124},"\"https:\u002F\u002Fstorage.googleapis.com\u002Fmy-bucket\"",[104,307,128],{"class":110},[104,309,310,312,314],{"class":106,"line":157},[104,311,173],{"class":117},[104,313,121],{"class":110},[104,315,316],{"class":117},"172800\n",[104,318,319],{"class":106,"line":170},[104,320,184],{"class":110},[18,322],{},[21,324,326],{"id":325},"separate-video-origin","Separate video origin",[14,328,329,330,333,334,336],{},"If your videos are served from a different origin than images, you can configure a ",[85,331,332],{},"videoOrigin",". In the admin dashboard, this field appears when ",[32,335,71],{}," is selected as the CMS type.",[14,338,339],{},"Via the API:",[95,341,343],{"className":97,"code":342,"language":99,"meta":100,"style":100},"{\n  \"slug\": \"my-project\",\n  \"cms\": \"generic\",\n  \"originUrl\": \"https:\u002F\u002Fimages.my-cdn.com\",\n  \"videoOrigin\": \"https:\u002F\u002Fvideos.my-cdn.com\",\n  \"cacheTTL\": 86400\n}\n",[85,344,345,349,359,369,380,392,400],{"__ignoreMap":100},[104,346,347],{"class":106,"line":107},[104,348,111],{"class":110},[104,350,351,353,355,357],{"class":106,"line":114},[104,352,118],{"class":117},[104,354,121],{"class":110},[104,356,125],{"class":124},[104,358,128],{"class":110},[104,360,361,363,365,367],{"class":106,"line":131},[104,362,134],{"class":117},[104,364,121],{"class":110},[104,366,139],{"class":124},[104,368,128],{"class":110},[104,370,371,373,375,378],{"class":106,"line":144},[104,372,147],{"class":117},[104,374,121],{"class":110},[104,376,377],{"class":124},"\"https:\u002F\u002Fimages.my-cdn.com\"",[104,379,128],{"class":110},[104,381,382,385,387,390],{"class":106,"line":157},[104,383,384],{"class":117},"  \"videoOrigin\"",[104,386,121],{"class":110},[104,388,389],{"class":124},"\"https:\u002F\u002Fvideos.my-cdn.com\"",[104,391,128],{"class":110},[104,393,394,396,398],{"class":106,"line":170},[104,395,173],{"class":117},[104,397,121],{"class":110},[104,399,178],{"class":117},[104,401,402],{"class":106,"line":181},[104,403,184],{"class":110},[14,405,406,407,409],{},"Video file types (mp4, webm, mov, m4v) will be fetched from ",[85,408,332],{},", while all other asset types use the primary origin.",[18,411],{},[21,413,415],{"id":414},"configurable-options","Configurable options",[14,417,418],{},"Each tenant supports these configuration options:",[420,421,422,441],"table",{},[423,424,425],"thead",{},[426,427,428,432,435,438],"tr",{},[429,430,431],"th",{},"Option",[429,433,434],{},"Type",[429,436,437],{},"Default",[429,439,440],{},"Description",[442,443,444,463,478,499,517,534,551],"tbody",{},[426,445,446,452,457,460],{},[447,448,449],"td",{},[85,450,451],{},"origin",[447,453,454],{},[85,455,456],{},"string",[447,458,459],{},"—",[447,461,462],{},"Primary HTTPS origin URL (required)",[426,464,465,469,473,475],{},[447,466,467],{},[85,468,332],{},[447,470,471],{},[85,472,456],{},[447,474,459],{},[447,476,477],{},"Separate origin for video files",[426,479,480,485,490,496],{},[447,481,482],{},[85,483,484],{},"cacheTTL",[447,486,487],{},[85,488,489],{},"number",[447,491,492,495],{},[85,493,494],{},"172800"," (2 days)",[447,497,498],{},"Edge cache duration in seconds (60 – 2,592,000)",[426,500,501,506,511,514],{},[447,502,503],{},[85,504,505],{},"allowedTypes",[447,507,508],{},[85,509,510],{},"string[]",[447,512,513],{},"— (all types allowed)",[447,515,516],{},"Content-Types to allow. If not set, all types are served",[426,518,519,524,528,531],{},[447,520,521],{},[85,522,523],{},"stripQueryParamsFor",[447,525,526],{},[85,527,510],{},[447,529,530],{},"— (query params included in cache key)",[447,532,533],{},"File extensions where query params are stripped from cache key",[426,535,536,541,545,548],{},[447,537,538],{},[85,539,540],{},"blockedBotsRegex",[447,542,543],{},[85,544,456],{},[447,546,547],{},"(default pattern)",[447,549,550],{},"Custom regex for blocking bots by User-Agent",[426,552,553,558,562,564],{},[447,554,555],{},[85,556,557],{},"websiteDomain",[447,559,560],{},[85,561,456],{},[447,563,459],{},[447,565,566,567,570],{},"Your frontend domain, sent as ",[85,568,569],{},"Referer"," to origin",[18,572],{},[21,574,576],{"id":575},"response-transformer-with-generic-origins","Response transformer with generic origins",[14,578,579,580,583,584,586],{},"Since v0.4.0, the response transformer has built-in support for generic origins via ",[85,581,582],{},"cms: \"generic\"",". Pass your origin URL as ",[85,585,87],{}," and all matching asset URLs in the response payload will be rewritten automatically:",[95,588,592],{"className":589,"code":590,"language":591,"meta":100,"style":100},"language-typescript shiki shiki-themes github-dark","import { transformCmsAssetUrls } from \"@synchronized-studio\u002Fresponse-transformer\"\n\nconst transformed = transformCmsAssetUrls(data, {\n  cms: \"generic\",\n  originUrl: \"https:\u002F\u002Fmy-bucket.s3.amazonaws.com\",\n  cmsAssetsUrl: \"https:\u002F\u002Fmy-project.cmsassets.com\"\n})\n","typescript",[85,593,594,609,615,633,642,651,659],{"__ignoreMap":100},[104,595,596,600,603,606],{"class":106,"line":107},[104,597,599],{"class":598},"snl16","import",[104,601,602],{"class":110}," { transformCmsAssetUrls } ",[104,604,605],{"class":598},"from",[104,607,608],{"class":124}," \"@synchronized-studio\u002Fresponse-transformer\"\n",[104,610,611],{"class":106,"line":114},[104,612,614],{"emptyLinePlaceholder":613},true,"\n",[104,616,617,620,623,626,630],{"class":106,"line":131},[104,618,619],{"class":598},"const",[104,621,622],{"class":117}," transformed",[104,624,625],{"class":598}," =",[104,627,629],{"class":628},"svObZ"," transformCmsAssetUrls",[104,631,632],{"class":110},"(data, {\n",[104,634,635,638,640],{"class":106,"line":144},[104,636,637],{"class":110},"  cms: ",[104,639,139],{"class":124},[104,641,128],{"class":110},[104,643,644,647,649],{"class":106,"line":157},[104,645,646],{"class":110},"  originUrl: ",[104,648,152],{"class":124},[104,650,128],{"class":110},[104,652,653,656],{"class":106,"line":170},[104,654,655],{"class":110},"  cmsAssetsUrl: ",[104,657,658],{"class":124},"\"https:\u002F\u002Fmy-project.cmsassets.com\"\n",[104,660,661],{"class":106,"line":181},[104,662,663],{"class":110},"})\n",[14,665,666,667,670],{},"You can also use the dedicated ",[85,668,669],{},"transformGenericAssetUrls"," function directly:",[95,672,674],{"className":589,"code":673,"language":591,"meta":100,"style":100},"import { transformGenericAssetUrls } from \"@synchronized-studio\u002Fresponse-transformer\"\n\nconst transformed = transformGenericAssetUrls(data, {\n  originUrl: \"https:\u002F\u002Fmy-bucket.s3.amazonaws.com\",\n  cmsAssetsUrl: \"https:\u002F\u002Fmy-project.cmsassets.com\"\n})\n",[85,675,676,687,691,704,712,718],{"__ignoreMap":100},[104,677,678,680,683,685],{"class":106,"line":107},[104,679,599],{"class":598},[104,681,682],{"class":110}," { transformGenericAssetUrls } ",[104,684,605],{"class":598},[104,686,608],{"class":124},[104,688,689],{"class":106,"line":114},[104,690,614],{"emptyLinePlaceholder":613},[104,692,693,695,697,699,702],{"class":106,"line":131},[104,694,619],{"class":598},[104,696,622],{"class":117},[104,698,625],{"class":598},[104,700,701],{"class":628}," transformGenericAssetUrls",[104,703,632],{"class":110},[104,705,706,708,710],{"class":106,"line":144},[104,707,646],{"class":110},[104,709,152],{"class":124},[104,711,128],{"class":110},[104,713,714,716],{"class":106,"line":157},[104,715,655],{"class":110},[104,717,658],{"class":124},[104,719,720],{"class":106,"line":170},[104,721,663],{"class":110},[14,723,724,725,728,729,732],{},"Both approaches will rewrite URLs like ",[85,726,727],{},"https:\u002F\u002Fmy-bucket.s3.amazonaws.com\u002Fimages\u002Fphoto.jpg"," to ",[85,730,731],{},"https:\u002F\u002Fmy-project.cmsassets.com\u002Fimages\u002Fphoto.jpg",", preserving the path and query parameters.",[18,734],{},[21,736,738],{"id":737},"notes","Notes",[26,740,741,744],{},[29,742,743],{},"The origin must be HTTPS. HTTP origins are rejected.",[29,745,746],{},"The path structure is preserved 1:1 — the request path is appended directly to the origin URL.",[748,749,750],"style",{},"html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":100,"searchDepth":114,"depth":114,"links":752},[753,754,759,760,761,762],{"id":23,"depth":114,"text":24},{"id":64,"depth":114,"text":65,"children":755},[756,757,758],{"id":92,"depth":131,"text":93},{"id":207,"depth":131,"text":208},{"id":265,"depth":131,"text":266},{"id":325,"depth":114,"text":326},{"id":414,"depth":114,"text":415},{"id":575,"depth":114,"text":576},{"id":737,"depth":114,"text":738},"Proxy any HTTPS origin — S3, R2, GCS, or a custom server — through the Cachely edge network with global caching and bot protection.","md",{},"\u002Fdocs\u002Fgeneric-origin",{"title":5,"description":763},"docs\u002Fgeneric-origin","Nty3xSPhRAzOsvw9cQ52skhogX9YmB2dPq_maWNSSTw",1777579477924]