Closed guoyunhe closed 5 years ago
Google PageSpeed Insights gives some useful tips:
font-display: auto;
. So when remote fonts haven't been loaded, browsers can still render text with system fonts. Users can see texts 1-3 seconds earlier and here won't be a blink of rendering text. I have changed this in chameleon theme.Anyway, we got a 99 score with en-test.opensuse.org , a really good result!
- Increase cache period. Maily all wiki images. Usually images uploaded to wiki won't change. We can set the cache period to 1 month? @cboltz What do you think?
I'm not sure if this is a good idea. If someone uploads a new version of a picture, it will be stored under the old filename, which means users will see the old picture while the cache is valid. Therefore 1 month is much too long.
A shorter cache time (maybe 1 hour?) would be OK, but I'm not sure how much we'd win with that - I'd say typical visitors rarely visit the same page twice within an hour, and therefore always need different pictures. I'd even guess that the only win would be to avoid a few warnings on the google pagespeed page ;-)
Anyway, we got a 99 score with en-test.opensuse.org , a really good result!
I deployed the "load from static.o.o" change to production, which means you'll get similar results for all wikis now :-)
BTW: Since you also mentioned possible PHP performance improvements - we already use php7-opcache and memcached, which AFAIK are the two most important performance optimizations.
@cboltz I tested Wikipedia sites. Files uploaded to Wikimedia Commons have several hours cache period. However, Wikimedia Commons is not a typical MediaWiki instance. Sadly, MediaWiki uses the same URL for new revisions of images and makes image caching hard. Possible solution might be append ?version=4
to all image URLs through an extension.
I'm afraid appending a query string with the version will make things worse. Last time I tested (2 year ago IIRC), Firefox re-requested all files with a query string on every page load even if their cache time was still valid.
Plan to do some performance benchmark. Most wiki sites can be twice faster by tweaking cache configuration. PHP7 might also have some new performance solutions.