Created
August 4, 2011 15:55
-
-
Save vishal-kajjam/1125504 to your computer and use it in GitHub Desktop.
question
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The possible prefetch for albums show url is | |
("/users/46641/albums/45103.xml", {:owner=>true, :per_page=>12, :page=>1}, {:url_prefix=>"http://staging.mobicious.com"}) | |
this could change if we are viewing a friends album or we are logged out to | |
("/users/46641/albums/45103.xml", {:owner=>false, :per_page=>12, :page=>1, :hidden =>0}, {:url_prefix=>"http://staging.mobicious.com"}) | |
("/users/46641/albums/45103.xml", {:owner=>false, :per_page=>12, :page=>1, :hidden =>0, :privacy => 0}, {:url_prefix=>"http://staging.mobicious.com"}) | |
My question is should we prefectch all these calls as we would not know in advance which params are passed until the condition is actually called? |
To clarify, don't move all of the prefetches to after the conditional, just the ones that depend on it
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For now, just put the prefetch after the conditional. Try to move the conditional to as early in the action method as possible, and then put the prefetches after it. It won't be quite as fast but I think we should avoid adding extra calls for the time being.