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
I was following this tutorial for caching by query:
http://www.theoutfield.net/blog/2011/02/caching-an-umbraco-macro-by-querystring-parameter
When I access my page like this: /theme?entityId=1&themeId=2
This gets cached by query & page and everything works fine.
The problem is with url rewriting as these url's are accessed in another way like this:
<add name="entityTheme" virtualUrl="~/(.*)/(\d*)/thema/(\d*)/(.*)" rewriteUrlParameter="IncludeQueryStringForRewrite" destinationUrl="~/$1/theme?entityId=$2&themeId=$3" ignoreCase="true" />
With macro:
<umbraco:macro runat="server" Alias="Theme" PageId="[@entityId],[@themeId]" />
Without caching I get the specific content based on the query, but when I cache it it gets the content from the first page and it gets cached and every other page displays this cached one.
It's as if the code recognizes the id via:
Request.QueryString["entityId"]
But the macro not via this:
I didn't found any information or bugs around this so I like to be confirmed if this is a bug or am I forgetting something with the url rewriting?
BTW I'm using Umbraco 4.7.2
I've got it to work.
To use querycaching with url rewriting I had to seperate the parameters like below and define these properties explicitly in the macro itself.
<umbraco:macro runat="server" Alias="Theme" EntityId="[@entityId]" ThemeId="[@themeId]" />
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Caching by query with urlrewriting problem
I was following this tutorial for caching by query:
http://www.theoutfield.net/blog/2011/02/caching-an-umbraco-macro-by-querystring-parameter
When I access my page like this: /theme?entityId=1&themeId=2
This gets cached by query & page and everything works fine.
The problem is with url rewriting as these url's are accessed in another way like this:
With macro:
Without caching I get the specific content based on the query, but when I cache it it gets the content from the first page and it gets cached and every other page displays this cached one.
It's as if the code recognizes the id via:
But the macro not via this:
I didn't found any information or bugs around this so I like to be confirmed if this is a bug or am I forgetting something with the url rewriting?
BTW I'm using Umbraco 4.7.2
I've got it to work.
To use querycaching with url rewriting I had to seperate the parameters like below and define these properties explicitly in the macro itself.
is working on a reply...