-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Dynamic Body not to be cached when a Func is used to created the body #826
Comments
I'm not sure if there is caching when you use a Func to define your response. Caching can only be enabled for Can you please double check? |
@paulmctigue |
@StefH It always returns the correct response string for the request. That bit is fine. However memory is increased for each new string that is returned. I'll double check it now |
Yes I can understand that the memory is increased because the return value from that Func is a string, and this is saved internally. However I think that this is only kept in memory for logging the request. So cleaning the logging could help, or I can investigate if in case it's a Func, the response is not saved to the logging. |
Yes its the log entries that are consuming the memory - this object WireMock.Util.BodyData.
This solves the issue. |
Maybe have a global setting to opt of this type of logging when setting up the server (in WireMockServerSettings). |
Yes a good idea. I'll see if this can be added, however, it will take some time because I first want merge some other PR's. |
@paulmctigue Preview version : https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions |
Tested this and the memory kept on increasing.
Are there log entries for request as well as responses? |
A log entry defines the request AND the response. So the memory will increase, but not as much as before (in case you had big xml-strings to return). If you do not want log entries at all, you can set the |
@paulmctigue |
merged |
I'm using wirenet.net as a standalone process. The response func code below loads an existing file from disk, mutates the string and return it to the user. In my case it mutates all the dates relative to the todays date.
Because it a dynamics response I don't want the response to be cached. Currently (version 1.5.6), I think, the behaviour is caching the response every time its invoked increasing the memory on each request.
The text was updated successfully, but these errors were encountered: