您的網頁可能具有的任何靜態文件都應由您的網絡服務器提供,例如, Apache的。除非必須阻止某些文件訪問某些人,否則Django不應該參與其中。
這裏,I found an example of how to do it:
# our production setup includes a caching load balancer in front.
# we tell the load balancer to cache for 5 minutes.
# we can use the commented out lines to tell it to not cache,
# which is useful if we're updating.
<FilesMatch "\.(html|js|png|jpg|css)$">
ExpiresDefault "access plus 5 minutes"
ExpiresActive On
#Header unset cache-control:
#Header append cache-control: "no-cache, must-revalidate"
</FilesMatch>
靜態文件應由要麼阿帕奇/ lighthttpd/...你使用什麼都Web服務器提供服務... – shahjapan 2010-10-21 06:53:52