Skip to content

Commit 25ecc0f

Browse files
committed
Move notes to clean up code
1 parent 88fe633 commit 25ecc0f

File tree

2 files changed

+15
-19
lines changed

2 files changed

+15
-19
lines changed

TODO.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,21 @@
1313
update youtube video - have nicer mic now too. maybe do a quick "hi i'm ian, built this because..." but 5 seconds max, then get to the point.
1414
set video poster to be the interface not your face.
1515

16-
17-
18-
19-
16+
* fetchContentIndex() :: await cacheIndix
17+
"Note that an HTTP error response (e.g., 404) will not trigger an exception. It will return a normal response object that has the appropriate error code."
18+
but it does trigger an exception... ?
19+
20+
* fetchContentIndex() :: return await
21+
test updates to cache on server side get pulled in immediately. need to have a version of the db for each user, and add that as url cachebuster?
22+
or etags?
23+
" The caching API doesn't honor HTTP caching headers."
24+
if use cachebuster, would want to remove the other version from cache
25+
26+
* cacheIndex() qniCache.put()
27+
cache.add() does't store non-200 responses, but cache.put does, so have to validate
28+
don't wanna store a 500 error
29+
also wanna make sure that the json body is valid b/c don't wanna store an application-level error message
30+
caller has a try/catch and some error handling, should probably move that down here and then avoid caching errors
2031

2132
### Next minor version
2233

components/content-index.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,7 @@ export async function fetchContentIndex( pluginVersion, userDbVersion, apiRootUr
5151
*/
5252
await cacheIndex( cacheName, url, response.clone() );
5353

54-
// "Note that an HTTP error response (e.g., 404) will not trigger an exception. It will return a normal response object that has the appropriate error code."
55-
// um, but it does trigger an exception... ?
56-
5754
return [ ...await response.json() ];
58-
59-
/*
60-
test updates to cache on server side get pulled in immediately. need to have a version of the db for each user, and add that as url cachebuster?
61-
or etags?
62-
// " The caching API doesn't honor HTTP caching headers."
63-
if use cachebuster, would want to remove the other versno from cache
64-
*/
6555
}
6656

6757
/**
@@ -141,11 +131,6 @@ async function cacheIndex( cacheName, url, response ) {
141131
*/
142132
qniCache.put( url, response );
143133

144-
// cache.add() does't store non-200 responses, but cache.put does, so have to validate
145-
// don't wanna store a 500 error
146-
// also wanna make sure that the json body is valid b/c don't wanna store an application-level error message
147-
// caller has a try/catch and some error handling, should probably move that down here and then avoid caching errors
148-
149134
await deleteOldCaches( cacheName );
150135
}
151136

0 commit comments

Comments
 (0)