简体   繁体   中英

MediaWiki sends wrong header expires

I have Debian, Apache, MediaWiki. I set Expires in .htaccess for plus one month. MediaWiki sends header Expires : Thu, 01 Jan 1970 00:00:00 GMT. But if I create any simple script or file, it shows the correct information. Anyone else encountered this? I noticed this on many MediaWiki sites. Thank you.

I use this .htaccess: https://raw.githubusercontent.com/MaxKorz/htaccess/master/.htaccess but edit expires for plus one month.

Don't manage MediaWiki's caching behavior with external tools. Expires: set to 1970 is normal for MW without a HTTP cache in front of it (and even with a cache it will be set to expire immediately, but with a s-maxage). If you're worried that clients will be requesting stuff repeatedly - there's no problem here because If-Modified-Since will be used to avoid unneeded transfers. Without this, there will be problems with letting clients know when a page has changed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM