Comments (9)
I've tried to make it work in 6bd5031 (it should, but it sadly doesn't, I think). Will take another stab at it soon!
from serve.
nice! I may have spotted a bug (I'll comment on the commit) but I also could be wrong :)
from serve.
Sadly, that wasn't the problem. I've tried a few things, but nothing seems to work. The main problem is probably that the files (except the assets of micro-list itself) don't even get saved to the cache. Maybe @rauchg can take a stab at this?
All in all, the request doesn't contain the "if-modified-since" header (except when it's an asset, like I said).
from serve.
@leo you must supply an ETag
first with every file, which could be a very quick hashing function (like crc32
) concatenated file mtime
from serve.
Should be fixed in v0.5.0
!
from serve.
Hey,
Just wondering if it's possible to get more infos on how caching really works.
Let's suppose I build my frontend at t1 and produce 2 files vendor.js and app.js, and serve them on now-serve. As I would use it as a CDN, I want caching to kick in.
Now let's supposed I build frontend at t2 and produce the same 2 files that I redeploy with now-serve.
On second deploy, vendor.js is exactly the same as before (because my app libs did not change), but app.js is different (using hash compare is enought).
Will the headers be correctly set to enforce that the user see immediately the changes to app.js, and get a 304 for vendor.js ?
from serve.
@rauchg in my example, the vendor.js of the 2nd deployment has been rebuilt (so I guess it has different mtime), but content is exactly the same as before and I want a 304 instead of a cache miss. Is it possible with now-serve, or would it be possible to make it an option?
from serve.
according to my test it seems it's actually working like I want. The modified time of a file is not updated if the content is exactly the same as before as far as I see
Edit: no, not working
from serve.
Opened another issue because 304 does not work for me: #40
from serve.
Related Issues (20)
- Remove auto redirect
- Set server timezone to UTC
- Directory or file name with "#" or "?" does not work properly
- Do not serve hidden subfolders
- Restore silent mode HOT 2
- `npx serve` throws ENOENT error in [email protected] and newer HOT 1
- serve 14.2.1 CLI arguments issue http to https
- Testing local deployments for GitHub pages doesn't work since no `basePath` can be set HOT 6
- Add cleanUrls option to CLI interface
- IPV6 support
- Publish types for API with npm release
- Node.js 21: "[DEP0040] DeprecationWarning: The `punycode` module is deprecated." HOT 4
- serve didn't work in routing with react-router and vite in production HOT 1
- add --open to the CLI
- Anyway to run npx serve constantly? HOT 3
- `localhost:1234/foo/index.html.html` provokes a 404
- Add a file size limit to etag SHA calculations, fallback to "Last modified" when above this limit.
- Authentication is not available HOT 1
- Node.js 22: "[DEP0040] DeprecationWarning: The `punycode` module is deprecated." HOT 1
- Search functionality
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serve.