Committer: sbelyaev
LJSUP-13883: Journal pages optimizaiton : stage 1U trunk/cgi-bin/LJ/S2.pm U trunk/cgi-bin/LJ/Share.pm
Modified: trunk/cgi-bin/LJ/S2.pm =================================================================== --- trunk/cgi-bin/LJ/S2.pm 2012-10-11 11:43:54 UTC (rev 23105) +++ trunk/cgi-bin/LJ/S2.pm 2012-10-11 11:53:45 UTC (rev 23106) @@ -441,8 +441,7 @@ return $maxtime unless @from_db; # figure out who owns what we need - my $us = LJ::S2::get_layer_owners(@from_db); - + my $us = LJ::S2::get_layer_owners(@from_db); # break it down by cluster my %bycluster; # cluster => [ lid, lid, ... ] foreach my $lid (@from_db) { @@ -4021,7 +4020,12 @@ my $journalu = $this->{'journal'}->{'_u'}; my $poster = $this->{'poster'}->{'username'}; my $posteru = $this->{'poster'}->{'_u'}; - my $remote = LJ::get_remote(); + my $remote = $this->{'remote'}; + unless ($remote) { + $remote = LJ::get_remote(); + $this->{'remote'} = $remote; + } + my $null_link = { '_type' => 'Link', '_isnull' => 1 }; my $real_user = $this->{'real_journalid'} ? LJ::want_user($this->{'real_journalid'}) : undef; @@ -4181,7 +4185,12 @@ return $null_link; } - my $etypeid = 'LJ::Event::JournalNewComment'->etypeid; + my $etypeid = $this->{'__jnc_cache'}; + unless ($etypeid) { + $etypeid = 'LJ::Event::JournalNewComment'->etypeid; + $this->{'__jnc_cache'} = $etypeid; + } + my $newentry_etypeid = 'LJ::Event::JournalNewEntry'->etypeid; my $newentry_sub = $this->{__newentry_sub}->{$journalu->id} || undef; Modified: trunk/cgi-bin/LJ/Share.pm =================================================================== --- trunk/cgi-bin/LJ/Share.pm 2012-10-11 11:43:54 UTC (rev 23105) +++ trunk/cgi-bin/LJ/Share.pm 2012-10-11 11:53:45 UTC (rev 23106) @@ -79,14 +79,6 @@ my $cache_key; if ( my $entry = delete $opts->{'entry'} ) { - unless (keys %$opts) { - $cache_key = 's2:cache:share:js:' . - $entry->journalid . ":" . $entry->jitemid; - - my $data = LJ::MemCache::get($cache_key); - return $data if $data; - } - $opts->{'title'} = LJ::ejs( LJ::Text->drop_html($entry->subject_raw) ); $opts->{'url'} = $entry->url; @@ -102,7 +94,6 @@ my $result_text = qq{<script type="text/javascript">LJShare.link($opts_out);</script>}; - LJ::MemCache::set($cache_key, $result_text, 5 * 60) if $cache_key; return $result_text; }