Fossil

Check-in [c7194b66]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Make the "fossil cache" command an accessory that only shows up when doing "fossil help --all". Remove unused variables from the implementation.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:c7194b668b8ce417c6a84f8c285bc7b08c45d3fe
User & Date: drh 2014-04-25 21:18:27
Context
2014-04-25
21:34
Add a mention of the "fossil cache" command to the server load management discussion on the "server.wiki" page. And mention "fossil cache" in the change log. Documentation changes only. check-in: 34ea8daf user: drh tags: trunk
21:18
Make the "fossil cache" command an accessory that only shows up when doing "fossil help --all". Remove unused variables from the implementation. check-in: c7194b66 user: drh tags: trunk
21:11
Add a cache that will save /zip and /tarball objects and reissue them from cache when requested a second time. The "fossil cache" command is used to control the cache. Turned off by default and must be enabled using "fossil cache init". check-in: 450b62ff user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/cache.c.

136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
...
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
...
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
** Attempt to write pContent into the cache.  If the cache file does
** not exist, then this routine is a no-op.  Older cache entries might
** be deleted.
*/
void cache_write(Blob *pContent, const char *zKey){
  sqlite3 *db;
  sqlite3_stmt *pStmt;
  int blobId = 0;
  int rc = 0;
  int nKeep;

  db = cacheOpen(0);
  if( db==0 ) return;
  sqlite3_busy_timeout(db, 10000);
  sqlite3_exec(db, "BEGIN IMMEDIATE", 0, 0, 0);
................................................................................
** Possible reasons for returning zero:
**   (1)  This server does not implement a cache
**   (2)  The requested element is not in the cache
*/
int cache_read(Blob *pContent, const char *zKey){
  sqlite3 *db;
  sqlite3_stmt *pStmt;
  int blobId = 0;
  int rc = 0;

  db = cacheOpen(0);
  if( db==0 ) return 0;
  sqlite3_busy_timeout(db, 10000);
  sqlite3_exec(db, "BEGIN IMMEDIATE", 0, 0, 0);
  pStmt = cacheStmt(db, 
................................................................................
cache_read_done:
  sqlite3_exec(db, "COMMIT", 0, 0, 0);
  sqlite3_close(db);
  return rc;
}

/*
** COMMAND: cache
** Usage: %fossil cache SUBCOMMAND
**
** Manage the cache used for potentially expensive web pages such as
** /zip and /tarball.   SUBCOMMAND an be:
**
**    clear        Remove all entries from the cache.
**







<







 







<







 







|







136
137
138
139
140
141
142

143
144
145
146
147
148
149
...
192
193
194
195
196
197
198

199
200
201
202
203
204
205
...
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
** Attempt to write pContent into the cache.  If the cache file does
** not exist, then this routine is a no-op.  Older cache entries might
** be deleted.
*/
void cache_write(Blob *pContent, const char *zKey){
  sqlite3 *db;
  sqlite3_stmt *pStmt;

  int rc = 0;
  int nKeep;

  db = cacheOpen(0);
  if( db==0 ) return;
  sqlite3_busy_timeout(db, 10000);
  sqlite3_exec(db, "BEGIN IMMEDIATE", 0, 0, 0);
................................................................................
** Possible reasons for returning zero:
**   (1)  This server does not implement a cache
**   (2)  The requested element is not in the cache
*/
int cache_read(Blob *pContent, const char *zKey){
  sqlite3 *db;
  sqlite3_stmt *pStmt;

  int rc = 0;

  db = cacheOpen(0);
  if( db==0 ) return 0;
  sqlite3_busy_timeout(db, 10000);
  sqlite3_exec(db, "BEGIN IMMEDIATE", 0, 0, 0);
  pStmt = cacheStmt(db, 
................................................................................
cache_read_done:
  sqlite3_exec(db, "COMMIT", 0, 0, 0);
  sqlite3_close(db);
  return rc;
}

/*
** COMMAND: cache*
** Usage: %fossil cache SUBCOMMAND
**
** Manage the cache used for potentially expensive web pages such as
** /zip and /tarball.   SUBCOMMAND an be:
**
**    clear        Remove all entries from the cache.
**