openSUSE / wiki

openSUSE Wiki
http://en.opensuse.org
25 stars 17 forks source link

Performance improvements #35

Closed guoyunhe closed 5 years ago

guoyunhe commented 5 years ago

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.

guoyunhe commented 5 years ago

Google PageSpeed Insights gives some useful tips:

Anyway, we got a 99 score with en-test.opensuse.org , a really good result!

https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fen-test.opensuse.org&tab=desktop

cboltz commented 5 years ago
  • 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.

guoyunhe commented 5 years ago

@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.

cboltz commented 5 years ago

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.