Skip to content

Cache user code snippets as well#545

Closed
wilzbach wants to merge 1 commit intodlang-tour:masterfrom
wilzbach:proper-caching
Closed

Cache user code snippets as well#545
wilzbach wants to merge 1 commit intodlang-tour:masterfrom
wilzbach:proper-caching

Conversation

@wilzbach
Copy link
Member

This is important when we start receiving requests from dlang.org.

image

The second request pair is with caching. Of course, without starting docker the execution is faster which btw we might be interested in looking into Linux LXC containers (see also: https://unix.stackexchange.com/questions/254956/what-is-the-difference-between-docker-lxd-and-lxc).

There is an outstanding issue with CORS for dlang.org, hence two requests are sent, but this is part of another PR.

.map!(a => tuple!("key", "time")(a[0], a[1].time))
.array
.sort!((a, b) => a.time < b.time)[0 .. $ / 2])
sourceHashToOutput_.remove(entry.key);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depending on the implementation it might be faster to alloc a new dictionary and insert the new "half" though I doubt this (and it shouldn't matter anyway because this is very infrequently called).

@wilzbach
Copy link
Member Author

Travis is currently broken due to https://www.traviscistatus.com/incidents/fyskznm7wg2c

@wilzbach
Copy link
Member Author

FYI: while it makes the tour faster, this is also intended to make dlang.org faster (-> dlang/dlang.org#1647).

@wilzbach
Copy link
Member Author

wilzbach commented Jul 5, 2017

Now that we have Nginx in-between, we could also look into setting up a POST request cache with Nginx, e.g.

https://medium.com/programming-articles/caching-post-responses-with-nginx-1c0c064bb6b0

@wilzbach
Copy link
Member Author

As we now also allow DUB packages, this might even be more interesting ;-)

@wilzbach
Copy link
Member Author

We now use nginx to cache POST requests, so I'm closing this for now as redundant.
If the Nginx caching doesn't work well, we might want to have a look into this in the future.
The only problematic part of the Nginx caching is that we can't insert logic like if dmd-nightly, don't cache.

@wilzbach wilzbach closed this Jul 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant