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

Is it possible to change the caching type of image provider in the runtime? #197

Open
hkayabilisim opened this issue Jul 19, 2021 · 4 comments
Assignees
Labels

Comments

@hkayabilisim
Copy link
Contributor

No description provided.

@hkayabilisim
Copy link
Contributor Author

I'm using Openshift OKD 4.7 and installed TeaStore without a problem. During a stress test, I want to change the caching type and observe its effect on TeaStore's overall performance.

@SimonEismann
Copy link
Contributor

After a quick look into the image provider code, it seems like this is currently not supported. @NSchmittUniWue Could you take a quick look if I didn't miss anything?

What type of trigger do you need to change the cache type? If e.g., a REST API would work for you, this should be pretty easy to implement. The code to set a new cache mode would look something like this.

storage = ImageProvider.IP.getStorage()
cachePredicate = new CacheAll<StoreImage>();
cache = new MostRecentlyUsed<StoreImage>(storage, cacheSize, cachePredicate);
ImageProvider.IP.setStorage(cache);

Creating the REST endpoint would mean copying and adapting this file:

https://github.com/DescartesResearch/TeaStore/blob/e1eea5ce948bd37a2f4217b7532a8557a4eee0e0/services/tools.descartes.teastore.image/src/main/java/tools/descartes/teastore/image/rest/ImageProviderEndpoint.java

Would this solution work for you? Otherwise we can also setup a quick call to discuss how we can make this work :)

@hkayabilisim
Copy link
Contributor Author

hkayabilisim commented Jul 19, 2021 via email

@SimonEismann
Copy link
Contributor

The other easily configurable parameter would be the algorithm in the recommender, but that would be slightly more complicated as a switch would require retraining I think.

Another option would be to make the number of images that are displayed per product page configurable on the server side instead of the client side.

Let me know if you need any support with implementing this :)

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

No branches or pull requests

3 participants