Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Asset serving breaks if you use a '/:user/:thing' type route #229

Open
Techwraith opened this Issue Oct 13, 2012 · 5 comments

Comments

Projects
None yet
2 participants
Contributor

Techwraith commented Oct 13, 2012

if you use a route like this:

router.get('/:user/:thing').to('Things.show');

Geddy will fail to serve up any assets. Perhaps we should look into this one - @larzconwell or @MiguelMadero want to give this one a shot?

Contributor

Techwraith commented Oct 13, 2012

looks like it only breaks if you add (.:format) to it...

Contributor

kieran commented Oct 14, 2012

Checking for a static file should be done before the router is queried, looks like it's done after now.

https://github.com/mde/geddy/blob/master/lib/app.js#L534 should only be 404 & 405

On Saturday, 13 October, 2012 at 7:46 PM, Daniel Erickson wrote:

looks like it only breaks if you add (.:format) to it...


Reply to this email directly or view it on GitHub (mde#229 (comment)).

Contributor

Techwraith commented Oct 14, 2012

Totally. I think our whole static file system needs a massive overhaul. It hasn't been touched in years.

Contributor

Techwraith commented Oct 14, 2012

@kieran The problem is, we don't want to have to hit the fs for every request - only the ones that need to be hit. I think this means we need to keep some sort of mapping of the filesystem in memory, but that could really suck. Any better ideas?

Contributor

kieran commented Oct 14, 2012

Caching the static fs listing wouldn't be much of a hit; it's a place to start. I would even cache the contents of small files (like favicons, CSS) to save disk activity for common requests. Maybe we could have a static cache memory limit in the config and default it to 1MB or so?

There must be a thing for this already, will check.

On 2012-10-13, at 8:30 PM, Daniel Erickson notifications@github.com wrote:

@kieran The problem is, we don't want to have to hit the fs for every request - only the ones that need to be hit. I think this means we need to keep some sort of mapping of the filesystem in memory, but that could really suck. Any better ideas?


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment