Commit 32b7085
committed
optimize: implement efficient approach for PR #8225 - store base64 directly in backend messages
- Remove unnecessary memory caching logic
- Store base64 data URLs directly in ClineMessage.images[] and ApiMessage content when first received
- Eliminate conversion overhead at API call time (base64 already available)
- Keep frontend memory efficient with webview URIs for display
- Much simpler and more efficient than caching approach
- One-time conversion: webview URI → base64 when storing in backend
- API calls use pre-stored base64 directly (no file I/O or conversion needed)
This achieves PR goals with optimal performance: frontend memory efficiency + instant API calls1 parent e7531e5 commit 32b7085
File tree
3 files changed
+16
-26
lines changed- src
- core
- prompts
- task
- integrations/misc
3 files changed
+16
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
201 | 200 | | |
202 | 201 | | |
203 | 202 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | 203 | | |
222 | 204 | | |
223 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1212 | 1212 | | |
1213 | 1213 | | |
1214 | 1214 | | |
1215 | | - | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
1216 | 1220 | | |
1217 | 1221 | | |
1218 | | - | |
1219 | | - | |
1220 | | - | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
1221 | 1225 | | |
1222 | 1226 | | |
1223 | | - | |
1224 | 1227 | | |
1225 | 1228 | | |
1226 | 1229 | | |
| |||
1482 | 1485 | | |
1483 | 1486 | | |
1484 | 1487 | | |
1485 | | - | |
1486 | | - | |
1487 | | - | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
1488 | 1495 | | |
1489 | 1496 | | |
1490 | 1497 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
0 commit comments