{"catalogRevision":"cat_f13ab9a494120b5e","recipeId":"page:guides:spring-boot:cdn-assets","recipeRevision":"r1","canonicalPath":"/guides/spring-boot/cdn-assets","label":"Deliver public assets through CDN for Spring Boot","family":"Framework operation","summary":"Cdn assets for a Spring Boot app on Ample. Verified on Spring Boot: a versioned, immutable-cached asset uploaded to a published bucket and served from the CDN URL. Build and start: ./mvnw -q -DskipTests package (or the Gradle wrapper) producing one application jar, then java -jar on the jvm-21 template (Temurin JDK 21) with server.port read from PORT.","representativeQueries":["Deliver public assets through CDN for Spring Boot","Where can I host Deliver public assets through CDN built with Spring Boot?","I need a public-origin configuration, versioned asset build and observable cache behavior."],"breadcrumbIds":["discovery","stack","stack:frameworks","stack:framework-spring-boot","page:guides:spring-boot:cdn-assets"],"breadcrumbs":[{"id":"discovery","label":"Agent hosting discovery","canonicalPath":"/discover/discovery","kind":"root"},{"id":"stack","label":"Frameworks and execution targets","canonicalPath":"/discover/stack","kind":"facet"},{"id":"stack:frameworks","label":"Frameworks","canonicalPath":"/discover/stack/frameworks","kind":"group"},{"id":"stack:framework-spring-boot","label":"Spring Boot","canonicalPath":"/discover/stack/framework-spring-boot","kind":"atom"},{"id":"page:guides:spring-boot:cdn-assets","label":"Deliver public assets through CDN for Spring Boot","canonicalPath":"/guides/spring-boot/cdn-assets","kind":"recipe"}],"parentIds":["stack:framework-spring-boot","intent:add-cdn","pattern:versioned-static-assets"],"parents":[{"id":"stack:framework-spring-boot","label":"Spring Boot","canonicalPath":"/discover/stack/framework-spring-boot","kind":"atom"},{"id":"intent:add-cdn","label":"Add CDN","canonicalPath":"/discover/intent/add-cdn","kind":"atom"},{"id":"pattern:versioned-static-assets","label":"Versioned static assets","canonicalPath":"/discover/pattern/versioned-static-assets","kind":"atom"}],"resourceRequirements":["primitive:compute","primitive:cdn"],"infrastructureRequirements":[{"primitiveId":"primitive:compute","label":"Compute","canonicalPath":"/discover/primitive/compute","status":"verified","summary":"Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle and wake on request; sizes are the priced VM sizes."},{"primitiveId":"primitive:cdn","label":"CDN","canonicalPath":"/discover/primitive/cdn","status":"verified","summary":"The CDN host serves objects from published buckets. It does not front app compute and is not a cache or key-value store."}],"framework":"Spring Boot","workload":"Deliver public assets through CDN","releaseStatus":"published","supportStatus":"verified","executionStatus":"ready","docsOnly":false,"prerequisites":["A Spring Boot project (./mvnw -q -DskipTests package (or the Gradle wrapper) producing one application jar, then java -jar on the jvm-21 template (Temurin JDK 21) with server.port read from PORT)","A bucket from `ample bucket create` with credentials passed as encrypted S3_* environment variables","An Ample account token with servers:write, buckets:read"],"testedConfiguration":{"template":"jvm-21","runtime":"java","size":"s-1vcpu-2gb","build":"./mvnw -q -DskipTests package","start":"java -jar $(ls target/*.jar | grep -v -- '-plain' | head -n 1)"},"inputSchema":{"additionalProperties":false,"properties":{"env":{"description":"Encrypted environment variables","items":{"pattern":"^[A-Z][A-Z0-9_]*=.*$","type":"string"},"maxItems":50,"type":"array"},"name":{"description":"App name","maxLength":63,"minLength":1,"pattern":"^[a-z0-9-]+$","type":"string"},"path":{"description":"Project directory or ample.toml service","maxLength":512,"minLength":1,"type":"string"},"release_command":{"description":"Migration command run before activation","maxLength":512,"type":"string"}},"required":["env","name","path"],"type":"object"},"outputSchema":null,"workflowSteps":[{"title":"Build and start","body":"./mvnw -q -DskipTests package (or the Gradle wrapper) producing one application jar, then java -jar on the jvm-21 template (Temurin JDK 21) with server.port read from PORT; the server must bind 0.0.0.0 on PORT."},{"title":"Publish a bucket for public assets","body":"Publish only the asset bucket; upload versioned keys with an immutable Cache-Control header and build URLs from its public URL.","command":"ample bucket publish <bucket-name>"},{"title":"Verify","body":"Fetch the live URL and /p/versioned-static-assets on the example; on failure read the build and runtime logs.","command":"ample logs <deployment_id> --kind build"}],"examples":[{"title":"Spring Boot pattern fixture","description":"Verified CDN assets on Spring Boot.","sourceRef":"tests/deploy-canaries/spring-boot-patterns"}],"successChecks":[{"description":"app responds on its public URL","kind":"http_get","path":"/","expect":"ample canary spring boot patterns"},{"description":"versioned-static-assets check from the example","kind":"http_get","path":"/p/versioned-static-assets","expect":"see the pattern fixture checks"}],"limitations":["Verified on the jvm-21 template at s-1vcpu-2gb; other sizes and Spring Boot major versions are not verified.","Region, compliance attestations and request-duration limits are unknown and not claimed.","The CDN serves published-bucket objects only; cache rules, purge and TTL control are not verified."],"costEstimate":{"currency":"USD","monthlyAmount":5.0,"authoritative":true,"basis":"size prices from pricing.toml (loaded by the API) at build revision c580c64e344ac6391cd4873bd47103b1c5701b48","components":[{"name":"app server","size":"s-1vcpu-1gb","quantity":1.0,"monthlyAmount":5.0}],"note":"Always-on monthly price of the tested sizes; apps auto-pause when idle. Buckets are allocation-priced per quota and not included."},"evidenceSummary":[{"kind":"canary_run","summary":"Spring Boot pattern fixture deployed on Ample (./mvnw -q -DskipTests package (or the Gradle wrapper) producing one application jar, then java -jar on the jvm-21 template (Temurin JDK 21) with server.port read from PORT); for this guide: a versioned, immutable-cached asset uploaded to a published bucket and served from the CDN URL.","observedAt":"2026-09-21T02:34:39Z","implementationRevision":"1d28ae0 (CLI 0.1.21)","expiresAt":"2027-03-20T02:34:39Z","scope":{"checks":["/p/versioned-static-assets"],"template":"jvm-21"}}],"lastVerifiedAt":"2026-09-21T02:34:39Z","mcpBinding":{"registryRef":"mcp:ample_deploy","toolName":"ample_deploy","schemaHash":"876465fce906da0c224d62961d3343064108ebe30af80cf1b87094974e948853","observedAt":"2026-09-22T00:31:22.774679+00:00","implementationRevision":"e6446ceea69b","requiredScopes":["servers:write","buckets:read"],"bindingState":"current"},"unknowns":["region availability is unknown until a verified region fact is recorded","compliance attestations are unknown; none are claimed"],"formats":{"html":"https://ample.computer/guides/spring-boot/cdn-assets","markdown":"https://ample.computer/guides/spring-boot/cdn-assets.md","json":"https://api.ample.computer/v1/catalog/recipes/page%3Aguides%3Aspring-boot%3Acdn-assets"},"nextActions":[{"actionId":"browse-catalog","label":"Browse the catalog index","operationId":"catalog_index","method":"GET","relativePath":"/v1/catalog","origin":"api","parameters":{},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"search-recipes","label":"Search published recipes by intent, stack and constraints","operationId":"search_recipes","method":"POST","relativePath":"/v1/catalog/search","origin":"api","parameters":{"body":{"limit":5,"query":"Deliver public assets through CDN for Spring Boot"}},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"plan:page:guides:spring-boot:cdn-assets","label":"Prepare a side-effect-free deployment plan for an authorized project","operationId":"plan_deployment","method":"POST","relativePath":"/v1/catalog/plan","origin":"api","parameters":{"body":{"inputs":{},"projectId":"<workspace or server id you own>","recipeId":"page:guides:spring-boot:cdn-assets","recipeRevision":"r1"}},"requiresAuthentication":true,"requiresApproval":false},{"actionId":"auth-setup","label":"Read the existing agent authentication setup","operationId":"existing_auth_setup","method":"GET","relativePath":"/mcp/setup","origin":"api","parameters":{},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"browse:stack:framework-spring-boot","label":"Browse Spring Boot","operationId":"browse_node","method":"GET","relativePath":"/v1/catalog/nodes/stack%3Aframework-spring-boot","origin":"api","parameters":{"nodeId":"stack:framework-spring-boot"},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"browse:intent:add-cdn","label":"Browse Add CDN","operationId":"browse_node","method":"GET","relativePath":"/v1/catalog/nodes/intent%3Aadd-cdn","origin":"api","parameters":{"nodeId":"intent:add-cdn"},"requiresAuthentication":false,"requiresApproval":false},{"actionId":"browse:pattern:versioned-static-assets","label":"Browse Versioned static assets","operationId":"browse_node","method":"GET","relativePath":"/v1/catalog/nodes/pattern%3Aversioned-static-assets","origin":"api","parameters":{"nodeId":"pattern:versioned-static-assets"},"requiresAuthentication":false,"requiresApproval":false}]}