jamesfoley
Explore posts from serversUsing TypeScript with .env file
I was wondering if anyone could point me in the direction of resources that would guide me through the process of creating type safe environmental variables for a Deno project. I am using the @std/dotenv library to read the vars but how to make them type safe.
What would be considered best practice? Should I use Zod or can I extend an existing type/interface that exists?
Your help is gratefully appreciated.
1 replies
Help Understanding Cache Middleware
My understanding of caching is not great and I wonder if someone could help me with a few questions I have on caching.
If there are any learning resources that you think could help me I would be ever so grateful.
- How does Hono handle caching of requests for api endpoints or static assets on the server and on the client.
- Are requests/responses cached on the server as a default?
- Is server/client caching something I have to implement using the cache middleware.
- Is the cache middleware helper only for client cache or can it be used for server caching.
- How do I access cache information on the server.
- How does the serveStatic() method handle caching requests/responses for html css and img and javascript files.
- If I am serving static assets do I have to create the cache control for both the server and client .
- header for static assets. Is this done using the cache middleware.
Just trying to learn more and increase my understanding.
Regards
Jim
Learning Project Background.
I am working on a learning project. Four static pages pages home/login/signup/dashboard.
These pages are all served using the serveStatic() method.
I am also creating a simple crud api.
Just trying to learn more.
3 replies