Skip to content

feat: resolve #386 #387 #388 #400 — Redis eviction, HTTP/2 push, WS p…#424

Open
STX-Boot wants to merge 1 commit into
Smartdevs17:mainfrom
STX-Boot:feat/issues-386-387-388-400-infra-perf
Open

feat: resolve #386 #387 #388 #400 — Redis eviction, HTTP/2 push, WS p…#424
STX-Boot wants to merge 1 commit into
Smartdevs17:mainfrom
STX-Boot:feat/issues-386-387-388-400-infra-perf

Conversation

@STX-Boot
Copy link
Copy Markdown

…rotobuf, internal signing

Closes #386 — Redis cache eviction policy

  • Implement real ioredis connection in RedisCache (was a stub)
  • Set maxmemory-policy allkeys-lru and configurable maxmemory on connect
  • Add TTL to every cache entry via setex; add getMemoryInfo() for monitoring

Closes #387 — HTTP/2 server push and connection multiplexing

  • Add Link preload headers for critical fonts and CSS in next.config.ts so HTTP/2-aware proxies issue PUSH_PROMISE frames before HTML is parsed
  • Add custom_headers to aws_amplify_app in infra/main.tf to propagate server push hints through CloudFront (HTTP/2 enabled by default on Amplify)

Closes #388 — WebSocket binary protocol via Protocol Buffers

  • Add packages/types/src/websocket.proto — canonical schema for WireMessage, WireMessageBatch, and ClientMessage
  • backend/src/websocket/codec.ts — zero-dependency protobuf-compatible binary encoder (encodeWireMessage, encodeBatch) and ClientMessage decoder
  • managedConnection.ts — store WireMessage objects in queue; encode as binary protobuf (WireMessageBatch) or JSON text at flush time based on useBinary flag
  • server.ts — detect ?proto=1 query param; pass useBinary to ManagedConnection
  • frontend/lib/websocket/codec.ts — browser-native protobuf decoder (decodeServerBinary) using TextDecoder; zero deps
  • pool.ts — set binaryType='arraybuffer' when proto=1 in URL; decode binary frames with codec and re-serialize for existing ordered-delivery logic Fallback to JSON text frames for clients without ?proto=1

Closes #400 — HMAC request signing for API-to-API communication

  • backend/src/middleware/internalSignature.ts — HMAC-SHA256 signing with:
    • 5-minute timestamp replay-protection window
    • Key rotation via in-memory store (loaded from INTERNAL_API_SIGNING_KEYS env)
    • signRequest() helper for outbound internal calls
    • verifyInternalSignature() Express middleware for inbound calls
    • Audit logging for all auth successes and failures

What this PR does

Changes

  • List of notable files and modules touched (monorepo wiring, Sentry integration, dashboards, etc.)
  • Notes about the Turborepo configuration, shared packages, and ESLint/TS config

Why

  • Rationale for the changes and how they solve the Acceptance Criteria

How to test

  • Steps to reproduce locally, including commands to run build/test
  • Any environment variables needed (e.g., SENTRY_DSN)
  • How to verify the dashboards/alerts configuration (stubs or real)

Notes

…vs17#400 — Redis eviction, HTTP/2 push, WS protobuf, internal signing

Issue Smartdevs17#386 — Redis cache eviction policy
- Implement real ioredis connection in RedisCache (was a stub)
- Set maxmemory-policy allkeys-lru and configurable maxmemory on connect
- Add TTL to every cache entry via setex; add getMemoryInfo() for monitoring

Issue Smartdevs17#387 — HTTP/2 server push and connection multiplexing
- Add Link preload headers for critical fonts and CSS in next.config.ts
  so HTTP/2-aware proxies issue PUSH_PROMISE frames before HTML is parsed
- Add custom_headers to aws_amplify_app in infra/main.tf to propagate
  server push hints through CloudFront (HTTP/2 enabled by default on Amplify)

Issue Smartdevs17#388 — WebSocket binary protocol via Protocol Buffers
- Add packages/types/src/websocket.proto — canonical schema for WireMessage,
  WireMessageBatch, and ClientMessage
- backend/src/websocket/codec.ts — zero-dependency protobuf-compatible
  binary encoder (encodeWireMessage, encodeBatch) and ClientMessage decoder
- managedConnection.ts — store WireMessage objects in queue; encode as binary
  protobuf (WireMessageBatch) or JSON text at flush time based on useBinary flag
- server.ts — detect ?proto=1 query param; pass useBinary to ManagedConnection
- frontend/lib/websocket/codec.ts — browser-native protobuf decoder
  (decodeServerBinary) using TextDecoder; zero deps
- pool.ts — set binaryType='arraybuffer' when proto=1 in URL; decode binary
  frames with codec and re-serialize for existing ordered-delivery logic
  Fallback to JSON text frames for clients without ?proto=1

Issue Smartdevs17#400 — HMAC request signing for API-to-API communication
- backend/src/middleware/internalSignature.ts — HMAC-SHA256 signing with:
  - 5-minute timestamp replay-protection window
  - Key rotation via in-memory store (loaded from INTERNAL_API_SIGNING_KEYS env)
  - signRequest() helper for outbound internal calls
  - verifyInternalSignature() Express middleware for inbound calls
  - Audit logging for all auth successes and failures

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

@devjayy43 is attempting to deploy a commit to the smartdevs17's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 28, 2026

@STX-Boot Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment