mirror of
https://github.com/direct-img/direct-img.link.git
synced 2026-03-17 03:01:01 +00:00
Refactor: Update rate limits and fix markdown escaping
This commit is contained in:
14
README.md
14
README.md
@@ -16,12 +16,6 @@ Give your AI a system instruction to embed images using `direct-img.link` and th
|
|||||||
|
|
||||||
That's it. The image is searched, cached, and served.
|
That's it. The image is searched, cached, and served.
|
||||||
|
|
||||||
## How It Works
|
|
||||||
|
|
||||||
1. A request hits `direct-img.link/<query>`
|
|
||||||
2. If cached (within 30 days) → serves the image instantly from R2
|
|
||||||
3. If not cached → searches via Brave Image Search API → stores in R2 → serves
|
|
||||||
|
|
||||||
## URL Format
|
## URL Format
|
||||||
|
|
||||||
Use `+` to separate words, like Google:
|
Use `+` to separate words, like Google:
|
||||||
@@ -48,12 +42,11 @@ as the image URL. Use + to separate words. Example: 
|
### WAF Protection (Cloudflare Free)
|
||||||
|
|
||||||
| Rule | Limit | Action |
|
| Rule | Limit | Action |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| Global rate limit | 60 requests/min per IP | Block for 1 min |
|
| Rate Limit | 10 requests/10s per IP | Block for 10s |
|
||||||
| Burst protection | 10 requests/10s per IP | Challenge |
|
|
||||||
|
|
||||||
### New Searches (Cache Misses)
|
### New Searches (Cache Misses)
|
||||||
|
|
||||||
@@ -118,8 +111,7 @@ Create in your Cloudflare dashboard:
|
|||||||
|
|
||||||
**Security → WAF → Rate limiting rules:**
|
**Security → WAF → Rate limiting rules:**
|
||||||
|
|
||||||
1. **Global** — 60 req/min per IP → Block 60s
|
1. **Rate Limit** — 10 req/10s per IP → Block 10s
|
||||||
2. **Burst** — 10 req/10s per IP → Challenge
|
|
||||||
|
|
||||||
### 6. Deploy
|
### 6. Deploy
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user