[ 
https://issues.apache.org/jira/browse/COUCHDB-890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998265#comment-12998265
 ] 

Caolan McMahon commented on COUCHDB-890:
----------------------------------------

Having a module cache that can persist state between requests might not be a 
good idea since it could be unreliable with multiple js processes or break the 
caching rules. How would you know if a resource has changed if it also depends 
on the state of commonjs modules?

See: https://issues.apache.org/jira/browse/COUCHDB-1075 for a patch that 
implements a module cache which is cleared between requests. You don't get the 
same performance benefits, but you do get increased compatibility with modules 
which store some state on the module (such as template libraries), and it also 
fixes circular requires.

> Add caching to CommonJS modules
> -------------------------------
>
>                 Key: COUCHDB-890
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-890
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: JavaScript View Server
>         Environment: All
>            Reporter: mikeal
>         Attachments: commonjscache.diff
>
>
> We need some caching in the commonjs modules so that when you 
> require('jsdom') it doesn't eval it every time you do a GET request to a show 
> function.
> Patch coming.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to