Deploying a Multi-Domain Static Site Architecture: quickdumpnow.com Books Page with CloudFront Error Handling
This post covers the deployment of a receipts management page for a trailer rental business operating under quickdumpnow.com, including S3 object management strategies, CloudFront cache invalidation, and debugging custom error responses in CloudFront distributions.
What Was Done
We deployed a new /books section to quickdumpnow.com designed to serve as a receipts repository for the trailer rental business. The work involved:
- Creating and modifying HTML structure at
/Users/cb/Documents/repos/sites/quickdumpnow.com/books/index.html - Updating
robots.txtto block search engine indexing of the receipts area - Deploying content to S3 with dual-key strategy for URL consistency
- Debugging CloudFront custom error response configurations
- Performing targeted cache invalidation
- Integrating a Google Apps Script backend for automated port sheet management tied to charter bookings
Technical Details: S3 Deployment Strategy
The site is hosted in S3 with CloudFront as the CDN. Rather than relying solely on CloudFront's URL rewriting, we employed a dual-key upload strategy to ensure the /books path resolves cleanly:
# Upload the books page to both keys for maximum compatibility
s3 upload quickdumpnow.com/books/index.html s3://quickdumpnow-site-bucket/books/index.html
s3 upload quickdumpnow.com/books/index.html s3://quickdumpnow-site-bucket/books
This approach ensures that:
https://quickdumpnow.com/books/resolves tos3://quickdumpnow-site-bucket/books/index.htmlhttps://quickdumpnow.com/books(without trailing slash) resolves directly to thebookskey- Both URLs serve identical content without requiring a 301 redirect, reducing latency
The robots.txt was updated to explicitly block search engine crawling of the receipts section:
User-agent: *
Disallow: /books/
Disallow: /books
This prevents the receipts page from appearing in search results, maintaining privacy for business records.
CloudFront Cache Invalidation and Error Responses
After deploying the new objects to S3, we discovered that https://quickdumpnow.com/books was returning the homepage instead of the new books page. This indicated a CloudFront configuration issue.
The root cause: the CloudFront distribution had a custom error response configured that redirects all HTTP 404 errors to the homepage. While useful for providing a graceful experience, this masked the missing S3 object error. Once the S3 objects were properly uploaded with the correct object keys, we needed to invalidate CloudFront's cache:
# Invalidate specific paths
cloudfront invalidate-distribution --distribution-id E1X2Y3Z4ABC --paths "/books" "/books/*" "/robots.txt"
The distribution ID E1X2Y3Z4ABC (example) serves quickdumpnow.com. The invalidation targeted:
/books— the bare key we uploaded/books/*— any resources within the books directory/robots.txt— ensures the updated robots.txt is served immediately
CloudFront invalidations are typically processed within 30–60 seconds, but propagate globally across edge locations over the following minutes.
Infrastructure Architecture
The quickdumpnow.com infrastructure follows a standard static site pattern:
- S3 Origin:
quickdumpnow-site-bucket— stores all HTML, CSS, and static assets - CloudFront Distribution: Caches content at edge locations globally, with a TTL of 3600 seconds (1 hour) for most objects
- Route53: DNS records point
quickdumpnow.comto the CloudFront distribution CNAME - Custom Error Responses: The distribution is configured to serve the homepage for 404 errors, preventing "Not Found" pages from appearing to end users
The books page is entirely static HTML, requiring no server-side processing. This architecture minimizes operational overhead and provides excellent performance through CloudFront's global cache.
Backend Integration: Google Apps Script Port Sheet
Concurrent with the frontend deployment, we connected the quickdumpnow project to an existing Google Apps Script (GAS) automation for managing charter bookings and port records. The workflow involves:
- Port Log Sheet: A Google Sheet tab that tracks charter bookings, vessel information, and payment details
- GAS Deployment: Clasp CLI manages the Apps Script manifest and function deployments
- API Integration: The ExpenseTracker GAS file accesses the Port Log sheet via the Google Sheets API v4
We verified the sheet structure by reading the headers and first few data rows:
# List available tabs in the sheet
gsheets list-tabs --sheet-id {SHEET_ID}
# Read Port Log headers and sample data
gsheets read --sheet-id {SHEET_ID} --range "Port Log!A1:Z5"
The Port Log contains columns for charter date, vessel name, skipper, gross revenue, and expenses. We appended the most recent charter entry (Joseph Zurek charter) with a total revenue of $1,845.72:
# Append entry to Port Log using correct sheet tab ID
gsheets append --sheet-id {SHEET_ID} --range "Port Log!A:Z" \
--values "[['2024-01-XX', 'Charter Vessel', 'Joseph Zurek', 1845.72, ...]]"
This automation eliminates manual data entry and ensures financial records are consistent across systems.
Key Decisions
Dual S3 Key Upload: We chose to upload to both /books/index.html and /books to handle URL variations without redirects. This trades a small amount of storage for reduced latency and simplified user experience.
robots.txt Blocking: Receipts are business-sensitive data. Rather than relying on authentication, we use robots.txt directives to prevent search engine indexing, providing defense-in-depth.
CloudFront Custom Error Pages: The existing 404→homepage redirect is user-friendly for broken links, but it masked deployment issues. Future deployments should verify S3 object existence before assuming CloudFront caching is the problem.
What's Next
The books page is now live at https://quickdumpnow.com/books. Near-term work includes:
- Designing the receipts upload interface (likely a form with file input and metadata fields)
- Connecting uploaded receipts to the Port Log sheet for automatic expense tracking