Skip to content
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

Can't disable cache for RESTDataSource #1765

Closed
lmx2k5 opened this issue Oct 3, 2018 · 1 comment
Closed

Can't disable cache for RESTDataSource #1765

lmx2k5 opened this issue Oct 3, 2018 · 1 comment

Comments

@lmx2k5
Copy link

lmx2k5 commented Oct 3, 2018

RESTDataSource seems to cache everything and I cant figure out how to disable caching. For example I set up project which uses https://www.uuidgenerator.net/api/version4 service to generate UUID and grapqhl query always returns same UUID. This service returns header "Cache-Control: max-age=0, private, must-revalidate" so I guess responses should not be cached. I also tried to set ttl to 1 , but no effect

export class UUIDDatasource extends RESTDataSource {
	constructor() {
		super();
		this.baseURL = "https://www.uuidgenerator.net/api/version4";
	}

	async uuid() {
		return this.get('', null, {cacheOptions:{ttl:1}});
	}
}

I created sample project https://github.com/lmx2k5/rest-datasource-cache-test

@lmx2k5
Copy link
Author

lmx2k5 commented Oct 3, 2018

oh well, I found this issue #1511 and looks like I incorrectly configured datasources property in server.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant