You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m using Nuxt/Nitro to serve country-specific images from a custom Nitro handler. To set proper HTTP caching, I need ETag and Last-Modified (mtime). The Nitro static handler already does this, but there’s no public asset helper to reuse.
Requests
please export the public asset helpers so handlers can get { etag, lastModified/mtime, size } for a file from storage and set consistent headers.
What’s the recommended way to point an fs storage to the built public folder at runtime? In Docker, when WORKDIR differs from the build path, relative base (e.g. ../public) didn’t resolve for the fs driver. The only working setup was:
This feels brittle. Is there a documented alias/constant/helper for resolving the public directory, or can Nitro expose the static storage so handlers can reference it directly?
Maybe I missed it
If there’s already a documented API or alias for ETag/mtime and the public folder storage, please point me to it. Happy to switch if I overlooked something.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I’m using Nuxt/Nitro to serve country-specific images from a custom Nitro handler. To set proper HTTP caching, I need ETag and Last-Modified (mtime). The Nitro static handler already does this, but there’s no public asset helper to reuse.
Requests
please export the public asset helpers so handlers can get { etag, lastModified/mtime, size } for a file from storage and set consistent headers.
What’s the recommended way to point an fs storage to the built public folder at runtime? In Docker, when WORKDIR differs from the build path, relative base (e.g. ../public) didn’t resolve for the fs driver. The only working setup was:
This feels brittle. Is there a documented alias/constant/helper for resolving the public directory, or can Nitro expose the static storage so handlers can reference it directly?
Maybe I missed it
If there’s already a documented API or alias for ETag/mtime and the public folder storage, please point me to it. Happy to switch if I overlooked something.
Beta Was this translation helpful? Give feedback.
All reactions