What is a template extension and how can we reduce it if our application is for Google applications?

I am making my first app in Google App Engine. Before I just checked the correct results for my application. But then my application began to respond very late. Then I looked at documents with Google apps and started using apps. I am really new to this. I watched a video about it and got some things, but still I'm a little confused. Below is a graph for a single login request in my application:

enter image description here

and below is the code for my LoginCheckServlet:

 public class LoginCheckServlet extends HttpServlet {
     @SuppressWarnings("unchecked")
     public void doPost(HttpServletRequest req, HttpServletResponse resp)
     throws IOException {
        resp.setContentType("text/html");
        PrintWriter out = resp.getWriter();
        HttpSession session = req.getSession(true);
        PersistenceManager pm = PMF.get().getPersistenceManager();
        try
        {
            List<User> result = null;
            Query query = pm.newQuery(User.class);
            query.setFilter("email == emailParam");
            query.declareParameters("String emailParam");
            result = (List<User>) query.execute(req.getParameter("email"));
            if(result.size() == 0){
                out.println(0);
            }else{
                String pwd = req.getParameter("password");
                String userPwd = result.get(0).getPassword();
                if(pwd.equals(userPwd)){
                    result.get(0).setActive(true);
                    session.setAttribute("email", result.get(0).getEmail());
                    session.setAttribute("name", result.get(0).getName());
                    out.println("1");
                }else{
                    out.println("2");
                }
            }
         }catch(Exception ex)
         {
            out.println(ex);
         }
         finally
         {
            pm.close();
         }
     }
 }

google- 50-100 . 15167 . , ( ), , 140000. , ? ? , , , , - . .

+5
1

HTML- myallcode. , Google, - Django, jinja.

, , , Idea.Make , hashed.If , oyur . .

-, , memcache. .

memcache: -    google.appengine.ext import db    google.appengine.api import memcache

def top_arts(update = False):
  key = 'top'

  #Getting arts from memcache
  arts = memcache.get(key)

  #Check if key is defined in memcache
  #or an update has been invoked
  if update or not arts:
    #Querying the Google Data store using GQL
    arts = db.GqlQuery('SELECT * from Art ORDER BY created DESC LIMIT 10')
    memcache.set(key, arts)
  return arts

memcache, memcache

: memcache: -  arts = top_arts()

: -

#write your entry in database
<some database code>
#update memcache with this new entry
top_arts(update=True)
+1

All Articles