我有用于python页面的WSGI模块的apache服务器。Python + Apache网页不更新
我有用str(datetime.datetime.now())打印当前时间戳的index.wsgi文件。
问题是当我刷新页面时,我看不到它的更新,它在几秒钟之内跳跃,看起来像它有3-4旧的结果在缓存中,它正在显示它们..
我试图看它是否使用缓存的网页浏览器,但无法找到任何东西..
index.wsgi:
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import datetime
html="""
<HTML>
<HEAD><TITLE>Manual Runner</TITLE>
<BODY>
timestamp: {0}<BR><BR>
</BODY></HTML>
""".format(str(datetime.datetime.now()))
def application (env, r):
body = html
status = '200 OK'
response_headers = [ ('Content-Type', 'text/html'), ('Content-Length', str (len (body))) ]
r (status, response_headers)
return [body]
的httpd.conf:
WSGIScriptAlias//web_manager/manual_run/index.wsgi
<Directory /web_manager/manual_run>
Order allow,deny
Allow from all
Options +ExecCGI
AddHandler cgi-script .py
DirectoryIndex index.wsgi
</Directory>
任何想法?
谢谢。
你能显示你的index.wsgi文件吗? – Jivan
...以及您的Apache主机配置的相关部分,也可能是Web服务器响应的标头。 –