   generateScript = ->
     html = createHTML()
     return callback null, html
+
+  route = getRoute()
+  if cachedRoutes[route]
+    if (Date.now() - (cachedRouteTTL[route] || 0)  < cachingTimeInMS)
+      console.log "#{route} cache is still valid"
+      prefetchedFeeds = cachedRoutes[route]
+      return generateScript()
 
   # todo  - implement this prefetching for all groups
 

module.exports = (options = {}, callback)->

  {dash} = require 'bongo'

      prefetchedFeeds['activity.main'] = activity  if activity
      queue.fin()

  queue.push ->
    route = getRoute()
    cachedRoutes[route] = prefetchedFeeds
    cachedRouteTTL[route] = Date.now()
    console.log "#{route} cache is updated"
    queue.fin()

  dash queue, generateScript
