Skip to content

Commit d30a605

Browse files
authored
Disable caching
2 parents b57a272 + 4cf1c23 commit d30a605

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414

1515
### Added
1616
- Added a launcher function `launch` to make it easier to launch the app.
17-
- Semantic caching enabled by SemanticCaches.jl. You can change it by setting `cached=false` in the `launch()` function (minimum similarity for cache hit is 0.99).
17+
- Semantic caching provided by SemanticCaches.jl. You can change it by setting `cached=false` in the `launch()` function. It's disabled by default.
1818

1919
### Fixed
2020
- Fixed a bug when caching would error for certain types of HTTP body (eg, `IOBuffer`)

main.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ Pkg.activate(".")
33
## Required to support semantic caching
44
ENV["DATADEPS_ALWAYS_ACCEPT"] = "true"
55
using ProToPortal
6-
ProToPortal.launch(8000, "0.0.0.0"; async = false, cached = true, cache_verbose = true)
6+
ProToPortal.launch(8000, "0.0.0.0"; async = false, cached = false, cache_verbose = false)

src/server.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
launch(
33
port::Int = get(ENV, "PORT", 8000), host::String = get(
44
ENV, "GENIE_HOST", "127.0.0.1");
5-
async::Bool = true, cached::Bool = true, cache_verbose::Bool = false)
5+
async::Bool = true, cached::Bool = false, cache_verbose::Bool = false)
66
77
Launches ProToPortal in the browser.
88
@@ -13,20 +13,21 @@ This is a convenience wrapper around `Genie.up`, to customize the server configu
1313
- `port::Union{Int, String} = get(ENV, "PORT", "8000")`: The port to launch the server on.
1414
- `host::String = get(ENV, "GENIE_HOST", "127.0.0.1")`: The host to launch the server on.
1515
- `async::Bool = true`: Whether to launch the server asynchronously, ie, in the background.
16-
- `cached::Bool = true`: Whether to use semantic caching of the requests.
17-
- `cache_verbose::Bool = true`: Whether to print verbose information about the caching process.
16+
- `cached::Bool = false`: Whether to use semantic caching of the requests.
17+
- `cache_verbose::Bool = false`: Whether to print verbose information about the caching process.
1818
1919
If you want to remove the cache layer later, you can use `import HTTP; HTTP.poplayer!()`.
2020
"""
2121
function launch(
2222
port::Union{Int, String} = get(ENV, "PORT", "8000"),
2323
host::String = get(ENV, "GENIE_HOST", "127.0.0.1");
24-
async::Bool = true, cached::Bool = true, cache_verbose::Bool = true)
24+
async::Bool = true, cached::Bool = false, cache_verbose::Bool = false)
2525
## Loads app.jl in the root directory
2626
Genie.loadapp(pkgdir(ProToPortal))
2727

2828
## Enables caching
2929
ENV["CACHES_VERBOSE"] = cache_verbose ? "true" : "false"
30+
## disable until we can do length-adjusted semantic distance
3031
if cached
3132
@info "Caching enabled globally (for all requests, see `CacheLayer` module for details). Remove with `HTTP.poplayer!()`"
3233
HTTP.pushlayer!(CacheLayer.cache_layer)

0 commit comments

Comments
 (0)