Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I'm using the following to grab tagged articles. It seems straightforward, but its taking like 20 seconds to grab 20 articles on a dev server with no traffic. Am I approaching using tagged service wrong?
Thanks!Amir
@using umbraco.cms.businesslogic.Tags@inherits Umbraco.Web.Mvc.UmbracoTemplatePage@{ string tag = Request.QueryString["tag"]; var service = UmbracoContext.Application.Services.TagService;}@{ var taggedList = service.GetTaggedContentByTag(@tag); foreach(var tagged in taggedList.Take(20)) { <p>@Umbraco.Content(@tagged.EntityId).Name</p> }}
I think the tag service works directly on the database. Than can explain the performance hit.
Dave
Hi Dave, is there a better way to get tags with the new tag service? It seems like this method makes simple things like orderby complicated as well.
Thanks,Amir
This works much better: Umbraco.TagQuery.GetContentByTag(@tag)
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
TagService seems expensive
Hi,
I'm using the following to grab tagged articles. It seems straightforward, but its taking like 20 seconds to grab 20 articles on a dev server with no traffic. Am I approaching using tagged service wrong?
Thanks!
Amir
I think the tag service works directly on the database. Than can explain the performance hit.
Dave
Hi Dave, is there a better way to get tags with the new tag service? It seems like this method makes simple things like orderby complicated as well.
Thanks,
Amir
This works much better: Umbraco.TagQuery.GetContentByTag(@tag)
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.