title: Inroducing service-workers on mobile site
body: <p>I'm new to service workers. I want to integrate service workers in my site.My motive is to improve the performance of my website not making the website offline.Its a real estate website.</p>
  
  <p>So what i have done till now is create modular templates of my site and store them in the cache.
  for e.g. template1</p>
  
  <pre><code>&lt;div&gt;
       &lt;p&gt;#data&lt;/p&gt;
  &lt;div&gt;
  </code></pre>
  
  <p>whenever a fetch occurs on  my page i first call an api through ajax get the data and replace the #data variable in the cache response by actual api response and then i returned the new response to the browser.</p>
  
  <p><strong>Question 1:-</strong> So i want to know is that the right approach. for html template caching?</p>
  
  <p>In the above approach i'm getting challenges like loops and conditional statements in my html.
  <strong>Question 2:-</strong> Is there any way that i can cache the templates with loops and change them at run time?.</p>
  
  <p><strong>Question 3:-</strong> Say if i show the cached app-shell to the user initially, so is that going to effect my site's SEO ranking?.</p>
  
  <p><strong>Question 4:-</strong> I have to write new templates of the existing code, which means i have to maintain two codes one for service-workers and other for normal browsers which dont support service workers.Any solution to this?</p>
  
  <p>Regards</p>