-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow different cache times for different urls #94
Comments
I'm down to support it, but I'm not sure what the API would look like. Presumably it would be a hash keyed by req.url. |
excellent, thanks!
The most general way might be a hash keyed by regular expressions that the url is successively matched against (and |
Best to do it the right way, which sounds like hashes. |
+1, my use case being we have a directory with largeish, never changing assets in them, but the rest of the assets should be ~5min cache time. I haven't looked at the code yet, but my thoughts would be to check if Is this good or is there a more ecstatic way of doing things? I can submit a PR within the next week, since I expect this to be an important optimisation step I'll have to tackle anyway. |
I'm not sure what you mean here. I assumed that this would be a backwards-compatible change to |
Sorry, I was a little rushed. Something like this:
It would provide more flexibility and better performance than restricting matching to regexes IMO. |
Yeah okay, I see what you're saying. Seems easier to implement for sure. Yeah, I'd take a PR for that. |
That pull request never materialized apparently? :-) I could use this, and the function mechanism seems perfect to me. |
Yeah, to my recollection no PR. |
👍 unfortunately we changed course and didn't need this functionality, kudos to @TehShrike for addressing this |
Oh, I don't care about you guys, I need this! ;-) <3 |
From http-party/http-server#63:
I realized http-server is just using ecstatic under the hood, which also only allows setting a single max-age for all responses.
Any suggestions on the simplest approach to giving versioned assets a longer max-age than non-versioned assets? Would be happy to submit a patch if there is interest in supporting this.
The text was updated successfully, but these errors were encountered: