Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a216e83
Add GCS proxy endpoint for serving report files and MIME type mapping
max-ostapenko Dec 6, 2025
3b7b475
Merge branch 'main' into development
max-ostapenko Dec 6, 2025
44dcc55
Add IAM member for service account storage object viewer in Google Cl…
max-ostapenko Dec 6, 2025
43ae4ca
Merge branch 'development' of https://github.com/HTTPArchive/tech-rep…
max-ostapenko Dec 6, 2025
ef44f3a
chore: update @google-cloud/functions-framework dependency to allow m…
max-ostapenko Dec 6, 2025
42246b0
format Terraform
max-ostapenko Dec 6, 2025
36d542b
feat: add CDN controller and update API paths for versions and reports
max-ostapenko Dec 6, 2025
ecd955a
Apply suggestion from @Copilot
max-ostapenko Dec 6, 2025
b0ee537
feat: update GCS proxy endpoint to serve static files instead of reports
max-ostapenko Dec 6, 2025
6374c68
Merge branch 'development' of https://github.com/HTTPArchive/tech-rep…
max-ostapenko Dec 6, 2025
6a6ee58
feat: remove unused IAM member for storage object viewer
max-ostapenko Dec 6, 2025
3c367fa
feat: add tests for static file retrieval and error handling in API r…
max-ostapenko Dec 6, 2025
77880e5
feat: update API routes to serve static files instead of reports
max-ostapenko Dec 6, 2025
b33313b
feat: update API routes and MIME type handling for static files
max-ostapenko Dec 6, 2025
1c89af5
feat: remove cache management endpoints and related tests from API
max-ostapenko Dec 7, 2025
6ce30ce
feat: update Node.js version requirement in README
max-ostapenko Dec 7, 2025
9df1b6e
Merge branch 'main' into development
max-ostapenko Dec 7, 2025
798c3c1
Update src/__tests__/routes.test.js
max-ostapenko Dec 7, 2025
4f7ea5c
Update src/__tests__/routes.test.js
max-ostapenko Dec 7, 2025
ed6dc19
fix
max-ostapenko Dec 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 1 addition & 77 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is an HTTP Archive Reporting API that provides reporting data via various e

### Prerequisites

- Node.js 18+
- Node.js 22+
- npm
- Google Cloud account with necessary permissions
- Set environment variables:
Expand All @@ -30,7 +30,6 @@ The API will be available at <http://localhost:3000>
- **Cache Headers**: 6-hour cache control for static data
- **Health Check**: GET `/` returns health status
- **RESTful API**: All endpoints follow REST conventions
- **Backend caching**: Some responses are cached on the backend for 1 hours to improve latency

### `GET /`

Expand Down Expand Up @@ -501,51 +500,6 @@ Returns a JSON object with the following schema:
]
```

### `GET /cache-stats`

Provides statistics about the API's cache.

```bash
curl --request GET \
--url 'https://{{HOST}}/v1/cache-stats'
```

Returns a JSON object with the following schema:

```json
{
"cache_hits": 12345,
"cache_misses": 6789,
"last_cleared": "2023-10-01T12:00:00Z"
}
```

### `POST /v1/cache-reset`

Resets all caches in the API. This endpoint requires a POST request.

```bash
curl --request POST \
--url 'https://{{HOST}}/v1/cache-reset'
```

Returns a JSON object with the following schema:

```json
{
"success": true,
"message": "All caches have been reset",
"before": {
"queryCache": 150,
"dateCache": 12
},
"after": {
"queryCache": 0,
"dateCache": 0
}
}
```

## Testing

```bash
Expand Down Expand Up @@ -667,34 +621,4 @@ Response:
}
```

## Cache Stats Private Endpoint

The Cache Stats private endpoint provides information about the API's cache performance, including cache hits, misses, and the last time the cache was cleared. This endpoint is useful for monitoring and debugging cache behavior.

```bash
curl "https://tech-report-api-dev-226352634162.us-central1.run.app/v1/cache-stats" \
-H "Authorization: bearer $(gcloud auth print-identity-token)"
```

Returns a JSON object with the following schema:

```json
{
"queryCache": {
"total": 3220,
"valid": 2437,
"expired": 783,
"ttl": 3600000
},
"dateCache": {
"total": 4,
"valid": 4,
"expired": 0,
"ttl": 3600000
},
"config": {
"maxCacheSize": 5000,
"cleanupStrategy": "size-based-lru"
}
}
```
Loading