icyleaf / halite

💎HTTP Requests Client with a chainable REST API, built-in sessions and middlewares.
MIT License
170 stars 13 forks source link

New feature: local cache #35

Closed icyleaf closed 6 years ago

icyleaf commented 6 years ago

Related to #24

icyleaf commented 6 years ago

Update a little test:

Complie source code and get request "http://httpbin.ogr/anything"

$ time crystal main.cr
crystal main.cr  6.79s user 1.21s system 197% cpu 4.039 total

$ time crystal main.cr
crystal main.cr  2.18s user 0.50s system 133% cpu 2.006 total

It speed up 3x fast!

icyleaf commented 6 years ago

I find Halite::Features and Halite::Feature are quite confusing. I think having directly Halite::Logger and Halite::Cache would clearer.

That's my problem, i did not design the picture enough, I'm working on it, i will removing Features and let feature under Halite module.

It will a new PR to do (#36)

icyleaf commented 6 years ago

@j8r I was updated new design about local cache, please review the top content at #24. With new design, it does not use Tempfile.