Skip to content

Commit 4281ca6

Browse files
committed
removed uneeded comments and did some final clean up
1 parent 8703534 commit 4281ca6

File tree

2 files changed

+9
-20
lines changed

2 files changed

+9
-20
lines changed

resources.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ export class ExamplePageCache extends PageCache {
2525
}
2626
}
2727
28-
********** Call this URL to access only the HTML string in the cache: http://localhost:9926/ExamplePageCache/testPage **********
29-
3028
*/
3129

3230
/********************************************************************************************************** */
@@ -36,11 +34,10 @@ export class ExamplePageCache extends PageCache {
3634
/*
3735
Usage Instructions:
3836
39-
1. define the cache IDs.
37+
1. define the cache ID. (The ID is set using HarperDB REST handler):
38+
You can access the cache from the browser using the following URL: http://localhost:9926/PageCache/<cacheId>
4039
2. Customize `pageURL` based on where the page is hosted.
41-
3. Call this URL to access the cached content:
42-
http://localhost:9926/PageCacheResource/{yourCacheId}
43-
40+
4441
Example:
4542
- The returned `cachedData` will contain the HTML as a string.
4643
*/
@@ -75,8 +72,4 @@ export class PageCacheResource extends PageCache {
7572
}
7673
}
7774

78-
// you can access the cache from the browser using the following URL: http://localhost:9926/PageCache/<cacheId>
79-
80-
// The ID is set using HarperDB REST handler
81-
8275
PageCache.sourcedFrom(PageCacheResource);

schema.graphql

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
## Here we can define any tables in our database. This example shows how we define a type as a table using
2-
## the type name as the table name and specifying it is an "export" available in the REST and other external protocols.
2+
## the type PageCache as the table name and specifying it is an "export" available in the REST and other external protocols.
33

4-
# This will be the table where users can store their pages they would like to cache
5-
# Keep this table simple
4+
# This table will store cached webpages to be served from cache on subsequent requests.
65
type PageCache @table(expiration: 3600) @export {
7-
cacheControl: String
86
# Stores the Cache-Control headers for the page, which dictate how caching should be handled (e.g., max-age, no-cache).
7+
cacheControl: String
98

9+
# The ID as a primary key allows for uniquely identifying cached pages.
1010
id: ID @primaryKey
11-
# The primary key representing the URL path of the cached webpage.
12-
# Example: For the URL https://www.birkenstock.com/us/men/, the `id` should be "/us/men/".
13-
# This allows us to uniquely identify cached pages based on their path.
1411

15-
cachedData: String # Set type to Bytes to save as binary
16-
17-
# Stores the full HTML of the cached webpage as a string.
12+
# cachedData stores the full HTML of the cached webpage as a string.
1813
# This is the rendered content that will be served from cache on subsequent requests.
14+
cachedData: String # Set type to Bytes to save as binary
1915
}

0 commit comments

Comments
 (0)