コード例 #1
0
ファイル: cdn.py プロジェクト: diazinc/angular-python
 def any(self,path):
     epath = os.path.join(whereami, 'app/css/'+path)
     body = loadlocal(epath)
     if not isadmin():
         self.response.headers['cache-control'] = 'no-transform,public,max-age=60'
     self.response.headers['content-type'] = 'text/css'
     self.response.write(body)
コード例 #2
0
ファイル: cdn.py プロジェクト: diazinc/angular-python
 def any(self, path):
     epath = os.path.join(whereami, 'app/jscontrollers/'+path+'.js')
     logging.info("path = "+epath)
     body = loadlocal(epath)
     if not isadmin():
         self.response.headers['cache-control'] = 'no-transform,public,max-age=60'
     self.response.headers['content-type'] = 'text/javascript'
     self.response.write(body)    
コード例 #3
0
ファイル: cdn.py プロジェクト: diazinc/angular-python
 def any(self,path):
     try:
         if isAppEngineDeploy():
             body = resizedimageifneeded(path, "authorimg", "cdn.positiondial.com", "authorimg")
         else:
             result = urlfetch.fetch("http://www.positiondial.com/cdn/authorimg/"+path)
             body = result.content
         if not isadmin():
             self.response.headers['cache-control'] = 'no-transform,public,max-age=7200'
         self.response.headers['content-type'] = 'image/jpg'
         self.response.write(body)
     except Exception as e:
         logging.exception(e)
         self.abort(404)
コード例 #4
0
ファイル: cdn.py プロジェクト: diazinc/angular-python
 def any(self,path):
     body = load("/%s" % (path))
     if not isadmin():
         self.response.headers['cache-control'] = 'no-transform,public,max-age=1800'
     self.response.headers['content-type'] = 'image/jpg'
     self.response.write(body)