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

OptCached doesn't take into account the date of the source #2713

Closed
yegor256 opened this issue Dec 22, 2023 · 3 comments · Fixed by #2720
Closed

OptCached doesn't take into account the date of the source #2713

yegor256 opened this issue Dec 22, 2023 · 3 comments · Fixed by #2720
Assignees
Labels

Comments

@yegor256
Copy link
Member

yegor256 commented Dec 22, 2023

At the moment, OptCached accepts an XML document and returns its optimized version. It also checks, whether an already optimized XML exists in the cache. However, it doesn't pay attention to the date of the original XML and the date of the document in the cache. This often leads to errors because the data in the cache is already expired.

I think, we should change the interface of Optimization from Function<XML, XML> to Function<Path, XML>. It should accept the path of the source document, not the content of it.

Also, I think it's better to use Func from Cactoos instead of Function from JDK, since it allows checked exceptions to be thrown from the apply method.

@yegor256 yegor256 added the bug label Dec 22, 2023
@yegor256
Copy link
Member Author

@volodya-lombrozo can you please fix this? it's pretty urgent, since it blocks this: #2711

@volodya-lombrozo
Copy link
Member

@yegor256 Yes, I'll

@yegor256
Copy link
Member Author

@volodya-lombrozo it doesn't block #2711 anymore, but still would be nice to fix, since the entire caching mechanism is kind of broken now

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

Successfully merging a pull request may close this issue.

2 participants