| 146 | |
| 147 | '''[=#Q22_literalcaps Q22:] What are literal caps?''' |
| 148 | |
| 149 | A: |
| 150 | Literal caps (or LIT caps) are simply the base32 encoding of the file data, and are used for very small files. The threshold is 55 bytes (source: [https://tahoe-lafs.org/trac/tahoe-lafs/browser/trunk/src/allmydata/immutable/upload.py?rev=fd676a5846fce5da#L1410 immutable/upload.py]), which is |
| 151 | the break-even point at which the LIT filecap is the same length as a typical CHK filecap. They are sufficient (you don't even need network access to turn the LIT filecap into the data), and necessary (if you don't know the filecap for my data, you can't figure out the data). See this mailing list thread: |
| 152 | * [https://tahoe-lafs.org/pipermail/tahoe-dev/2010-April/004235.html Storing a small file leads to a weird read capability] (especially [https://tahoe-lafs.org/pipermail/tahoe-dev/2010-April/004237.html this message by Brian Warner]) |
| 153 | |
| 154 | Literal caps are supported for immutable files and immutable directories (see [https://tahoe-lafs.org/trac/tahoe-lafs/wiki/Capabilities the Capabilities wiki page]). Whenever the contents of the file or directory are small enough that it would be more efficient to fit the contents into the cap itself than the store the contents remotely and use the cap to fetch it, then it becomes a literal cap. |