Difference between revisions for Users / Eo Ny
|
← Previous edit
|
Next edit →
|
| Version1 | Version2 | ||
|---|---|---|---|
| 1713 | 1713 | ||
| 1714 | === Performance Considerations === | 1714 | === Performance Considerations === |
| 1715 | 1715 | ||
| 1716 |
==== |
1716 | ====Optimization Tips==== |
| 1717 | 1. **Minimize Session Writes:** | 1717 | 1. **Minimize Session Writes:** |
| 1718 |
|
1718 | - Session data only written during ##write_close()## or regeneration |
| 1719 |
|
1719 | - No unnecessary serialization during reads |
| 1720 | 2. **Garbage Collection:** | 1720 | 2. **Garbage Collection:** |
| 1721 |
|
1721 | - Probabilistic GC (based on ##cf_gc_probability##) |
| 1722 |
|
1722 | - Only runs on ~2% of requests by default |
| 1723 |
|
1723 | - Customize based on your session volume |
| 1724 | 3. **Nonce Cleanup:** | 1724 | 3. **Nonce Cleanup:** |
| 1725 |
|
1725 | - Expired nonces automatically removed on verification |
| 1726 |
|
1726 | - Verified nonces removed from storage |
| 1727 |
|
1727 | - No manual cleanup needed |
| 1728 | 4. **Session ID Validation:** | 1728 | 4. **Session ID Validation:** |
| 1729 |
|
1729 | - Regex-based validation is fast |
| 1730 |
|
1730 | - No database lookup needed |
| 1731 | 5. **Caching Strategy:** | 1731 | 5. **Caching Strategy:** |
| 1732 |
|
1732 | - Cache expensive lookups between session operations |
| 1733 |
|
1733 | - Session data loaded once per request |
| 1734 | 1734 | ||
| 1735 | ==== Benchmarks ==== | 1735 | ==== Benchmarks ==== |
| 1736 | 1736 | ||