-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
rest-cache is not aware of transformer plugin (or vice versa) #25
Comments
Hello ! |
Hi Thanks for getting back to me. I have tried both rest-cache first and last. Makes no difference :-/ Different load orders I have tried:
|
Happens the same for me. Also tried changing the order of the plugins with no result. The request ends up transformed, but the rest cache keeps the original non transformed value, checked this using Redis. |
Just thinking outloud, to my understanding, when a request is received it should first look if there's a cache entry, if yes respond with it, therefore saving unnecessary function executions and else. Otherwise execute all middleware functions and at the end (unless you say so and prefer to store the original data) make a new cache record. |
Anyone had any luck with this one? EDIT: There is light at the end of the tunnel. |
Was just about to reply, saw your edit and good catch! Was looking into this issue as well. So basically it is the transformer which has issues because it cannot detect a cached call? Is that right? |
Exactly - cached results return completely different context data. Checking the possible results now ... |
Thinking out loud: would it be possible to change the response of the cache so the transformer understands? |
Should be resolved by #35 and available on 4.2.5 |
Thanks for an awesome plugin :-)
When using strapi-plugin-transformer and rest-cache plugin only the first request from api is transformed. Subsequent and therefore cached api requests are not transformed.
Strapi 4.2.0
strapi-plugin-transformer 2.0.2 (Latest NPM)
strapi-plugin-rest-cache 4.2.4
strapi-plugin-rest-cache-provider-memory 4.2.4
Node 14 + 16
I have tried different orders in the plugins.js and different settings for each plugin, but it makes no difference. I have also tried disabling all other plugins (sentry, aws-upload, email).
It seems that somehow the rest-cache plugin is not aware of the transformer plugins transformations before storing it in cache.
Here are my rest-cache settings:
And the strapi-plugin-transformer settings:
The text was updated successfully, but these errors were encountered: