Commit graph

310 commits

Author SHA1 Message Date
maddalax
72c171709e wrap example in div 2025-08-16 09:47:51 -05:00
maddalax
5dba9d0167 param -> urlParam 2025-08-15 09:05:46 -05:00
github-actions[bot]
6f29b307ec Auto-update HTMGO framework version 2025-07-03 19:08:02 +00:00
Eliah Rusin
06f01b3d7c
Refactor caching system to use pluggable stores (#98)
* Refactor caching system to use pluggable stores

The commit modernizes the caching implementation by introducing a pluggable store interface that allows different cache backends. Key changes:

- Add Store interface for custom cache implementations
- Create default TTL-based store for backwards compatibility
- Add example LRU store for memory-bounded caching
- Support cache store configuration via options pattern
- Make cache cleanup logic implementation-specific
- Add comprehensive tests and documentation

The main goals were to:

1. Prevent unbounded memory growth through pluggable stores
2. Enable distributed caching support
3. Maintain backwards compatibility
4. Improve testability and maintainability

Signed-off-by: franchb <hello@franchb.com>

* Add custom cache stores docs and navigation

Signed-off-by: franchb <hello@franchb.com>

* Use GetOrCompute for atomic cache access

The commit introduces an atomic GetOrCompute method to the cache interface and refactors all cache implementations to use it. This prevents race conditions and duplicate computations when multiple goroutines request the same uncached key simultaneously.

The changes eliminate a time-of-check to time-of-use race condition in the original caching implementation, where separate Get/Set operations could lead to duplicate renders under high concurrency.

With GetOrCompute, the entire check-compute-store operation happens atomically while holding the lock, ensuring only one goroutine computes a value for any given key.

The API change is backwards compatible as the framework handles the GetOrCompute logic internally. Existing applications will automatically benefit from the

* rename to WithCacheStore

---------

Signed-off-by: franchb <hello@franchb.com>
Co-authored-by: maddalax <jm@madev.me>
2025-07-03 14:07:16 -05:00
github-actions[bot]
66b6dfffd3 Auto-update HTMGO framework version 2025-01-06 16:27:11 +00:00
maddalax
24b41a7604 Merge remote-tracking branch 'origin/master' 2025-01-06 10:26:19 -06:00
maddalax
0c84e42160 add info on how to change it 2025-01-06 10:26:15 -06:00
github-actions[bot]
ca4faf103e Auto-update HTMGO framework version 2025-01-06 16:25:41 +00:00
maddalax
4f537567ad allow port to be configured 2025-01-06 10:24:49 -06:00
maddalax
0d61b12561 fix snippet 2024-11-30 10:57:42 -06:00
maddalax
ab50eaecf4 mobile fixes css 2024-11-25 10:34:22 -06:00
maddalax
baf10419f7 fix examples link 2024-11-25 10:23:12 -06:00
maddalax
9b69b25d0b minimal htmgo doc 2024-11-21 07:45:34 -06:00
github-actions[bot]
909d38c7f4 Auto-update HTMGO framework version 2024-11-16 14:52:58 +00:00
maddalax
b06d1b14bd log http requests 2024-11-12 18:15:59 -06:00
github-actions[bot]
b3834bf559 Auto-update HTMGO framework version 2024-11-09 18:33:21 +00:00
github-actions[bot]
a756a0484f Auto-update HTMGO framework version 2024-11-09 18:06:38 +00:00
maddalax
841262341a test 2024-11-05 15:17:12 -06:00
maddalax
142411c0e5 test 2024-11-05 15:13:05 -06:00
maddalax
e424dac826 test 2024-11-05 15:09:22 -06:00
maddalax
7d04d8861f add windows instructions 2024-11-01 07:29:15 -05:00
github-actions[bot]
af0091c370 Auto-update HTMGO framework version 2024-11-01 11:11:25 +00:00
maddalax
2c4ac8b286
gen code for assets (#68)
* gen code for assets

* fix

* test
2024-11-01 06:10:35 -05:00
maddalax
4c6187e18d add docs for eval commands 2024-11-01 05:08:36 -05:00
maddalax
b75dadf00e add prefix 2024-10-31 18:19:32 -05:00
maddalax
e067a17f53 add more urls to sitemap 2024-10-31 18:10:11 -05:00
maddalax
06792019f8 add discord link 2024-10-31 13:55:27 -05:00
maddalax
f0b8118e00 Merge remote-tracking branch 'origin/master' 2024-10-31 13:40:47 -05:00
maddalax
e27cda5779 add discord route 2024-10-31 13:40:43 -05:00
github-actions[bot]
64f201f4a3 Auto-update HTMGO framework version 2024-10-31 17:00:12 +00:00
github-actions[bot]
479df08d63 Auto-update HTMGO framework version 2024-10-31 16:44:28 +00:00
github-actions[bot]
92f33c8cff Auto-update HTMGO framework version 2024-10-31 16:37:49 +00:00
github-actions[bot]
9ed353ebe3 Auto-update HTMGO framework version 2024-10-31 16:12:09 +00:00
maddalax
de0e06155b text input example 2024-10-31 10:16:03 -05:00
maddalax
44461b1ec7 add helper 2024-10-31 09:58:16 -05:00
maddalax
833708e38a wrap lines on examples 2024-10-31 09:56:37 -05:00
github-actions[bot]
7f5274b34d Auto-update HTMGO framework version 2024-10-31 14:45:06 +00:00
maddalax
f6556b579f css form on blur validation 2024-10-31 09:44:16 -05:00
maddalax
3cd7577b06 css fixes 2024-10-30 14:44:02 -05:00
maddalax
e6223a36b7 remove myapp 2024-10-30 14:32:27 -05:00
maddalax
60a37b65d6 change version 2024-10-30 14:17:35 -05:00
maddalax
5feb271aed fix 2024-10-30 14:14:12 -05:00
maddalax
cb6fcdd676 new favicon 2024-10-30 14:07:38 -05:00
maddalax
129c230c72 fix link 2024-10-30 13:50:52 -05:00
maddalax
1ce5f37fc4 set title 2024-10-30 13:39:07 -05:00
maddalax
2e60b84c83 Merge remote-tracking branch 'origin/master' 2024-10-30 13:29:24 -05:00
maddalax
61b215436b cleanup 2024-10-30 13:29:20 -05:00
github-actions[bot]
101bb022c9 Auto-update HTMGO framework version 2024-10-30 18:28:28 +00:00
maddalax
35877a1b2e
New Docs (#63)
* scripting enhancements

* tests

* cleanup / tests

* new docs wip

* add more docs

* more updates

* add caching docs

* add sse docs

* more docs

* sidebar, and fix navigation blocks

* remove old docs

* set proper meta

* fixes
2024-10-30 13:27:42 -05:00
github-actions[bot]
df9c7f9cf7 Auto-update HTMGO framework version 2024-10-29 13:45:48 +00:00