gitlab-org--gitlab-foss/app/controllers/explore
Yorick Peterse 154253cab5
Refactor TrendingProjectsFinder to support caching
== Public Projects

This finder class now _only_ returns public projects. Previously this
finder would also return private and internal projects. Including these
projects makes caching data much harder and less efficient. Meanwhile
including this data isn't very useful as very few users would be
interested in seeing projects they have access to as trending. That is,
the feature is more useful when you want to see what _other_ popular
projects there are.

== Caching

The data returned by TrendingProjectsFinder is now cached for a day
based on the number of months the data should be restricted to. The
cache is not flushed explicitly, instead it's rebuilt whenever it
expires.

== Timings

To measure the impact I changed the finder code to use the last 24
months instead of the last month. I then executed and measured 10
requests to the explore page. On the current "master" branch (commit
88fa5916ff) this would take an average of
2.43 seconds. Using the changes of this commit this was reduced to
around 1.7 seconds.

Fixes gitlab-org/gitlab-ce#22164
2016-10-05 16:39:03 +02:00
..
application_controller.rb Replace reject_blocked with reject_blocked! in callbacks. 2016-07-27 13:56:30 -06:00
groups_controller.rb Merge branch 'master' into issue_12658 2016-03-21 23:22:21 +01:00
projects_controller.rb Refactor TrendingProjectsFinder to support caching 2016-10-05 16:39:03 +02:00
snippets_controller.rb Use the configured Kaminari "per page" default 2016-03-19 17:37:54 -04:00