Repos / pytaku / ef8b357340
commit ef8b357340ddd1a2425d6f2124620d87f35d392e
Author: Bùi Thành Nhân <hi@imnhan.com>
Date:   Sun Aug 2 17:40:58 2020 +0700

    prefetch next chapter
    
    So when user actually navigates to next chapter they don't have to wait
    for the initial network request to source site.

diff --git a/pyproject.toml b/pyproject.toml
index 37c1cb5..9477d30 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
 [tool.poetry]
 name = "pytaku"
-version = "0.1.1"
+version = "0.1.2"
 description = ""
 authors = ["Bùi Thành Nhân <hi@imnhan.com>"]
 license = "AGPL-3.0-only"
diff --git a/src/pytaku/templates/chapter.html b/src/pytaku/templates/chapter.html
index 3df7cc2..866a446 100644
--- a/src/pytaku/templates/chapter.html
+++ b/src/pytaku/templates/chapter.html
@@ -7,6 +7,11 @@
 {% endblock %}
 
 {% block head %}
+
+{% if next_chapter %}
+<link rel="prefetch" href="{{ url_for('chapter_view', chapter_id=next_chapter['id'])}}">
+{% endif %}
+
 <style>
   html {
     background-color: #444;
@@ -43,6 +48,7 @@
     margin-right: 0;
   }
 </style>
+
 {% endblock %}
 
 {% block content %}