Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kjohnson/nf-large-cache-fix
Resolves the issue of large forms crashing on publish due to cache size.
https://github.com/kjohnson/nf-large-cache-fix
ninja-forms wordpress
Last synced: about 2 months ago
JSON representation
Resolves the issue of large forms crashing on publish due to cache size.
- Host: GitHub
- URL: https://github.com/kjohnson/nf-large-cache-fix
- Owner: kjohnson
- License: gpl-3.0
- Created: 2017-03-28T22:23:35.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-22T14:20:24.000Z (over 7 years ago)
- Last Synced: 2024-10-19T00:21:55.377Z (3 months ago)
- Topics: ninja-forms, wordpress
- Language: PHP
- Homepage:
- Size: 13.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ninja Forms - Large Cache Fix
Resolves the issue of large forms crashing on publish due to cache size.
## Methodology
This fix uses the `pre_option_{$option}` and `pre_update_option_{$option}` filters as as a sort of man-in-the-middle solution. Option updates are intercepted on update and "chunked" into multiple options, storing a reference to the created chunks in an additional option. Inversely, option requests are intercepted and joined back together before they are retuned.
## Example
Form Length: 515,988 characters
Chunk Size: 65,535 (TEXT)
Number of Chunks: 8
Number of Options: 10 (chunks + 2)## MySQL String Type Reference
| Type | Maximum length |
| ----- | ----- |
| TINYTEXT | 255 (2 8−1) bytes |
| TEXT | 65,535 (216−1) bytes = 64 KiB |
| MEDIUMTEXT | 16,777,215 (224−1) bytes = 16 MiB |
| LONGTEXT | 4,294,967,295 (232−1) bytes = 4 GiB |