[ previous ]
[ Contents ]
[ 1 ]
[ 2 ]
[ 3 ]
[ 4 ]
[ 5 ]
[ 6 ]
[ 7 ]
[ 8 ]
[ 9 ]
[ 10 ]
[ 11 ]
[ 12 ]
[ 13 ]
[ 14 ]
[ 15 ]
[ 16 ]
[ 17 ]
[ A ]
[ B ]
[ C ]
[ D ]
[ E ]
[ next ]
Smart Cache Manual
Chapter 10 - For programmers
10.1 Making Java 1.2+ .jar file
Java versions, starting from 1.2 (JVM Kaffe also do that), can run Java
applications more easily. You can make .jar file and run it from command line
by java -jar filename.jar or in Windows by double clicking on it.
-
cd src
-
Compile SC Java sources - javac -O *.java (or use distributed
.classes).
-
Make .jar file - jar cvfm scache.jar MANIFEST.MF *.class
gnu/rex/*.class
Because .jar file is just renamed .zip file, you can also copy file MANIFEST.MF
in SC archive to META-INF/MANIFEST.MF and pack compiled classes with this file
using any .zip utility.
If everything works you now have jar file.
10.2 Compiling Smart Cache sources
Distributed .class files are not compiled by -O switch of javac. If want to
have SC 'optimised', you can recompile it.
Change working directory to smartcache_home/src and execute command javac
-O *.java. If you have tar distribution running top-level gnumake
should work.
Do not compile Smart Cache using jikes. Some versions of jikes (1.13)
are not quite compatible with some JVMs (OS/2 for example).
10.3 Structure of .cacheinfo control files
Technical notes:
-
Java stores integers in high-endian (network) byte order.
-
INTEGER and LONG are signed types, 4 or 8 bytes long.
-
STRINGs are encoded using UTF8. String length (2 bytes) is stored first, data
follows.
-
Time is LONG integer, counted in milliseconds starting from 1.1.1970 (Unix
era).
Structure of .cacheinfo files (Version 4).
-
File Magic number (INT) 0x53433034 - ASCII encoded string 'SC04'.
-
Number of entries in this file(INT), structure of one entry follows:
-
Object name including query string (STRING) (test.php3?id=2211)
-
Content type (STRING) (text/html)
-
Local file name, not including directory name (STRING) (test.php3)
-
Redirect http header (STRING) ("")
-
Object size in bytes INT (2031)
-
HTTP return code INT (200)
-
Expire date LONG (none 0)
-
Date, when object was downloaded or checked LONG
-
Last modified date LONG (none=0)
-
Etag header (STRING) ("")
-
Content encoding (String) ("") May be
"gzip,x-gzip,compress,x-compress,deflate" See RFC 2616
-
Whole entry is successfully downloaded? BYTE (1=YES, 0=NO - ENTRY TRUNCATED).
Reserved for use in future auto-resume function.
Structure of .cacheinfo files (Version 3) used in SC from version 0.47 to 0.73.
-
File Magic number (INT) 0x53433033 - ASCII encoded string 'SC03'.
-
Number of entries in this file(INT), structure of one entry follows:
-
Object name including query string (STRING) (test.php3?id=2211)
-
Content type (STRING) (text/html)
-
Local file name, not including directory name (STRING) (test.php3)
-
Redirect http header (STRING) ("")
-
Object size in bytes INT (2031)
-
HTTP return code INT (200)
-
Expire date LONG (none 0)
-
Date, when object was downloaded or checked LONG
-
Last modified date LONG (none=0)
-
Content encoding (String) ("") May be
"gzip,x-gzip,compress,x-compress,deflate" See RFC 2616
-
Whole entry is successfully downloaded? BYTE (1=YES, 0=NO - ENTRY TRUNCATED).
Reserved for use in future auto-resume function.
Following OLD format of .cacheinfo files is used in SC from version
0.30 to 0.46.
Structure of OLD .cacheinfo files (Version 2)
-
Number of entries in this file(INT), structure of one entry follows:
-
Object name including query string (STRING) (test.php3?id=2211)
-
Content type (STRING) (text/html)
-
Local file name, not including directory name (STRING) (test.php3)
-
Redirect http header (STRING) ("")
-
Object size in bytes INT (2031)
-
HTTP return code INT (200)
-
Expire date LONG (none 0)
-
Date, when object was downloaded or checked LONG
-
Last modified date LONG (none 0)
[ previous ]
[ Contents ]
[ 1 ]
[ 2 ]
[ 3 ]
[ 4 ]
[ 5 ]
[ 6 ]
[ 7 ]
[ 8 ]
[ 9 ]
[ 10 ]
[ 11 ]
[ 12 ]
[ 13 ]
[ 14 ]
[ 15 ]
[ 16 ]
[ 17 ]
[ A ]
[ B ]
[ C ]
[ D ]
[ E ]
[ next ]
Smart Cache Manual
0.84
Radim Kolar hsn@cybermail.net