KevinWorkman / StaticVoidGames

http://StaticVoidGames.com
GNU General Public License v3.0
5 stars 7 forks source link

suggestion: cache, use less IO #16

Open tgkprog opened 8 years ago

tgkprog commented 8 years ago

Don't know how many users you currently have but this will make your server slow and croak:

            File file = new File( servletContext.getRealPath("/WEB-INF/tutorialsContent/" + category + "/" + tutorial + ".markdown") );
String markdown = FileUtils.readFileToString(file);

Instead cache it. If you need help doing that I can help. Even a local cache will help, doubt the text in few files will be more than a few MB