-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
Update compileTime
used for caching?
#1062
Comments
I think we should find a way to include the diagram version:
The last modification date depends on:
The main issue is that MDN Web Docs states:
Since However, and as mentioned above, we will need to compute the |
So, I see no Then, why not just calculate the |
I don't think we should set If we really want to keep it then I guess we should use the release/build date (for instance, using Maven
Currently yes but I think the gateway server should implement this logic and return a
Because we want to save processing time. If we need to generate an image from the input in order to calculate an ETag that's a bit unfortunate.
That's the plan 👍 |
I'm in favor of outsourcing complexity to someone who already has implemented it instead of implementing it on my own. So, unless this is a real issue (I do not know the load on If it becomes a performance problem (or already is?), then looking at Kroki-side caching might make sense, but having more data on the workload would be great (how often is the same file requested, how long does generating take, …). |
Me too but in this case, NGINX (or really any reverse/frontend proxy) cannot do much with
As far as I know, NGINX won't use
To quote MDN: "The Last-Modified response HTTP header contains a date and time when the origin server believes the resource was last modified." https://kroki.io/graphviz/svg/eNpLyUwvSizIUHBXqPZIzcnJ17ULzy_KSanlAgB1EAjQ is basically a static image (we could generate it at build/compilation time). So the resource was last modified when Kroki was released/built.
Again, if we do that we cannot save processing time which is a missed opportunity.
This function will return the same output given the same input. So the We should implement this logic here:
And there:
We don't want to cache images (i.e., save on disk) on the Kroki server but we do want to be as efficient as possible. If we can skip work, respond faster and save bandwidth then we should do it. |
Anyway, this issue was about
Then, we can (statically) load I think we should create a dedicated issue for |
It seems that the design for (One open question about the |
👍🏻
Ideally yes but, currently, we do release all containers all together so it's not really an issue 😄 |
Build time as |
@MarcelWaldvogel I believe the initial scope of this issue was resolved in #1065. Should we close this issue? |
There is a hardcoded
compileTime
in the caching file, which is used in theLast-Modified
header of the returned files:kroki/server/src/main/java/io/kroki/server/response/Caching.java
Line 15 in c4e0bb3
As the returned diagram will only depend on the input string and the software version used, this seems like a good approach. However, the date in there is
Wed Sep 4 07:12:58 UTC 2019
and probably some pieces of the rendering have changed in these 2+ years, so that this variable should be updated regularly.What comes to mind right now:
compileTime
to a file not under source code control, which is e.g. created by the Makefile before themvn
runsWhat do you think?
The text was updated successfully, but these errors were encountered: