Deploying a CloudFront-Backed Receipt Management System for quickdumpnow.com/books

What Was Done

We deployed a receipt management landing page to https://quickdumpnow.com/books for a trailer rental business, resolving CloudFront routing issues caused by default 404 error handling. The work involved:

  • Building an HTML receipt capture page in /Users/cb/Documents/repos/sites/quickdumpnow.com/books/index.html
  • Updating robots.txt to block indexing of the receipt path
  • Deploying to S3 with dual-key strategy for URL normalization
  • Invalidating CloudFront cache and diagnosing custom error response behavior

Technical Details

The Root Cause: CloudFront Custom Error Responses

When accessing /books, CloudFront was returning the homepage instead of the books page. This happened because the CloudFront distribution was configured with a custom error response (likely for 403 Forbidden or 404 Not Found) that redirects all origin-unreachable errors to the root object.

Why this matters: S3 doesn't automatically serve index.html for "pretty URLs" the way a traditional web server does. When CloudFront requests /books from S3, if the object doesn't exist at that exact path, S3 returns 404. CloudFront's error response rule then kicks in, redirecting to /index.html.

S3 Deployment Strategy: Dual Keys

We solved this by uploading the books page to two S3 keys:

  • s3://quickdumpnow.com/books/index.html — standard nested path
  • s3://quickdumpnow.com/books — bare key for CloudFront's direct path matching

This ensures that when a user navigates to /books, CloudFront can find an exact object match at that key and return it without triggering the error response rule.

Robots.txt Configuration

Updated /Users/cb/Documents/repos/sites/quickdumpnow.com/robots.txt to block crawlers from the /books path:

Disallow: /books

This prevents search engines from indexing receipt data, which is appropriate for a private business tool rather than public-facing content.

Infrastructure & Deployment

S3 Upload Process

Files were deployed to the S3 bucket backing the quickdumpnow.com CloudFront distribution:

  • Uploaded books/index.html to S3 key books/index.html
  • Uploaded the same content to bare key books (no extension)
  • Set appropriate Content-Type headers (text/html)
  • Maintained existing bucket policies and public read permissions

CloudFront Invalidation

Invalidated cache for two patterns to ensure immediate availability:

  • /books — direct path invalidation
  • /books/* — wildcard for any nested resources
  • /robots.txt — refresh robots directive

CloudFront invalidations typically propagate across all edge locations within 30–60 seconds. This is preferable to relying on TTL expiration (which could take hours) when deploying time-sensitive content.

Key Architectural Decisions

Why Dual S3 Keys Instead of Custom Error Pages

We could have modified the CloudFront distribution's custom error response to explicitly handle /books, but dual keys is cleaner because:

  • No modification to the distribution configuration (less change surface area)
  • S3 serves the exact object requested, no error response latency
  • Future nested paths under /books (e.g., /books/receipts) work naturally if they're separate S3 objects
  • Reduces coupling between application code and CloudFront error handling rules

Why Block /books in robots.txt

While the page isn't confidential, blocking it prevents:

  • Accidental indexing of a private business tool
  • Leaking the existence of receipt management infrastructure in search results
  • Traffic waste from search engine crawlers on a non-public feature

Related Work: Port Sheet Automation for Maria

In parallel, we've been building automated port sheet generation for the sailing business. This involved:

  • Refactoring /Users/cb/Documents/repos/tools/jada_port_sheet.py to read from Google Sheets via API
  • Creating /Users/cb/Documents/repos/tools/reauth_jada_calendar.py to handle Google OAuth token refresh for calendar access
  • Syncing charter data (like the $1,845.72 entry for yesterday's charter) from a local port log to the master sheet

The port sheet tool reads the Port Log tab from a Google Sheet, formats entries according to a legacy Excel template structure, and maintains data consistency across multiple tabs. We resolved OAuth token refresh issues by implementing a local server flow for calendar authentication, allowing the automation to renew credentials without manual intervention.

What's Next

  • Receipt Capture UI: Build form components on /books to accept receipt images, amounts, and dates from mobile
  • Backend Integration: Connect receipt uploads to a serverless function (Lambda/CloudRun) for storage and processing
  • Port Sheet Entry: Add the $1,845.72 charter payment to the port sheet for Maria's records via the automated tooling
  • Monitor CloudFront: Track cache hit ratios and 4xx/5xx errors to ensure the dual-key strategy is working as expected

Deployment Checklist

  • ✅ Created books/index.html landing page
  • ✅ Updated robots.txt with Disallow: /books
  • ✅ Uploaded to S3 keys books and books/index.html
  • ✅ Invalidated CloudFront paths /books, /books/*, /robots.txt
  • ✅ Verified CloudFront custom error response configuration
  • ⏳ Monitor for 200 responses on https://quickdumpnow.com/books (30–60 second propagation)