# Make sure this expires from the varnish cache when new entries show
# up in this month.
# XXX: need to deal with the global view, but for now API callers come in directly
- if list:
+ if list and settings.PUBLIC_ARCHIVES:
resp['xkey'] = ' '.join(['pgam_{0}/{1}/{2}'.format(l.listid, year, month) for year, month in allyearmonths])
return resp
'atts': [{'id': a.id, 'name': a.filename} for a in m.attachment_set.all()],
}
for m in mlist], resp)
- resp['xkey'] = 'pgat_{0}'.format(msg.threadid)
+ if settings.PUBLIC_ARCHIVES:
+ resp['xkey'] = 'pgat_{0}'.format(msg.threadid)
return resp
'daysinmonth': daysinmonth,
'yearmonth': yearmonth,
})
- r['xkey'] = ' '.join(['pgam_{0}/{1}/{2}'.format(l.listid, year, month) for year, month in allyearmonths])
+ if settings.PUBLIC_ARCHIVES:
+ r['xkey'] = ' '.join(['pgam_{0}/{1}/{2}'.format(l.listid, year, month) for year, month in allyearmonths])
return r
'lists': lists,
'nextprev': nextprev,
})
- r['xkey'] = 'pgat_{0}'.format(m.threadid)
+ if settings.PUBLIC_ARCHIVES:
+ r['xkey'] = 'pgat_{0}'.format(m.threadid)
r['Last-Modified'] = http_date(newest)
return r
'lists': lists,
'isfirst': isfirst,
})
- r['xkey'] = 'pgat_{0}'.format(msg.threadid)
+ if settings.PUBLIC_ARCHIVES:
+ r['xkey'] = 'pgat_{0}'.format(msg.threadid)
r['Last-Modified'] = http_date(newest)
return r
r = HttpResponse('This message has been hidden.', content_type='text/plain')
else:
r = HttpResponse(row[0][2], content_type='text/plain')
- r['xkey'] = 'pgat_{0}'.format(row[0][0])
+ if settings.PUBLIC_ARCHIVES:
+ r['xkey'] = 'pgat_{0}'.format(row[0][0])
return r