htmgo/htmgo-site
franchb cfcfe7cb21
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
2025-07-03 17:46:09 +03:00
..
assets/public new favicon 2024-10-30 14:07:38 -05:00
internal log http requests 2024-11-12 18:15:59 -06:00
md New Docs (#63) 2024-10-30 13:27:42 -05:00
pages Use GetOrCompute for atomic cache access 2025-07-03 17:46:09 +03:00
partials add discord link 2024-10-31 13:55:27 -05:00
ui mobile fixes css 2024-11-25 10:34:22 -06:00
.dockerignore fix docker 2024-09-24 12:46:17 -05:00
assets.go dont embed assets in dev to speed up live reload 2024-09-25 10:44:43 -05:00
assets_prod.go dont embed assets in dev to speed up live reload 2024-09-25 10:44:43 -05:00
Dockerfile dont download a version 2024-09-26 15:38:34 -05:00
go.mod Auto-update HTMGO framework version 2025-01-06 16:27:11 +00:00
go.sum Auto-update HTMGO framework version 2025-01-06 16:27:11 +00:00
htmgo.yml cleanup 2024-10-30 13:29:20 -05:00
main.go add info on how to change it 2025-01-06 10:26:15 -06:00
package-lock.json dont replace tailwind file 2024-09-23 12:27:04 -05:00
package.json dont replace tailwind file 2024-09-23 12:27:04 -05:00
tailwind.config.js add some more docs 2024-09-24 12:39:16 -05:00
Taskfile.yml fix taskfile 2024-10-10 09:30:37 -05:00