Add Cache on Share Action

This commit is contained in:
Nicolas Lœuillet 2016-04-13 22:26:02 +02:00
parent d0545b6bd6
commit 222e09f140
2 changed files with 3 additions and 3 deletions

View file

@ -12,6 +12,7 @@ use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Form\Type\EntryFilterType;
use Wallabag\CoreBundle\Form\Type\EditEntryType;
use Wallabag\CoreBundle\Form\Type\NewEntryType;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
class EntryController extends Controller
{
@ -459,6 +460,7 @@ class EntryController extends Controller
* @param Entry $entry
*
* @Route("/share/{uuid}", requirements={"uuid" = ".+"}, name="share")
* @Cache(maxage="25200", public=true)
*
* @return \Symfony\Component\HttpFoundation\Response
*/

View file

@ -17,9 +17,7 @@
<li><a title="{{ 'entry.view.left_menu.set_as_starred'|trans }}" class="tool icon icon-star {% if entry.isStarred == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{{ 'entry.view.left_menu.set_as_starred'|trans }}</span></a></li>
<li><a id="nav-btn-add-tag" title="{{ 'entry.view.left_menu.add_a_tag'|trans }}"><span>{{ 'entry.view.left_menu.add_a_tag'|trans }}</span></a></li>
<li><a title="{{ 'entry.view.left_menu.delete'|trans }}" class="tool delete icon icon-trash" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{{ 'entry.view.left_menu.delete'|trans }}</span></a></li>
{% if craue_setting('share_public') %}
<li><a href="{{ path('share', {'uuid': entry.uuid }) }}" target="_blank" class="tool public" title="public"><span>public</span></a></li>
{% endif %}
{% if craue_setting('share_public') %}<li><a href="{{ path('share', {'uuid': entry.uuid }) }}" target="_blank" class="tool public" title="public"><span>public</span></a></li>{% endif %}
{% if craue_setting('share_twitter') %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool twitter icon icon-twitter" title="Tweet"><span>Tweet</span></a></li>{% endif %}
{% if craue_setting('share_mail') %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email icon icon-mail" title="Email"><span>Email</span></a></li>{% endif %}
{% if craue_setting('share_shaarli') %}<li><a href="{{ craue_setting('shaarli_url') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="shaarli"><span>shaarli</span></a></li>{% endif %}