Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RenderCachedRawContent - does not work. Or I do not understand how to use it. #335

Open
LarryBS opened this issue Sep 9, 2016 · 2 comments

Comments

@LarryBS
Copy link

LarryBS commented Sep 9, 2016

public string RenderCachedRawContent(string bundleName)
        {
            var cacheKey = CachePrefix + "_raw_" + bundleName;

            var output = rawContentCache.GetContent(cacheKey);
            if (output == null)
            {
                bundleState = rawContentBundleStateCache[cacheKey];
                if (bundleState == null)
                {
                    throw new InvalidOperationException(string.Format("No cached bundle state named {0} was found.", bundleName));
                }
                output = RenderRawContent(bundleName);
            }
            return output;
        }

The method falls when trying to fetch the output from the dictionary which does not contain the key as yet.
May be I use the method not correctly.
Could you explain how to?
Or there is a bug.

Thank you!

@AlexCuse
Copy link
Collaborator

AlexCuse commented Sep 9, 2016

Are you using "RenderCachedRawContent" to do your initial rendering? I'm guessing that is the problem, it is not terribly obvious.

I think you might be the first person to use this. @jkodroff needed it at some point but don't think he ever ended up using it.

@LarryBS
Copy link
Author

LarryBS commented Sep 11, 2016

Yes, guessed you'd answer this way. You see, I've got a task to realize this https://developers.google.com/speed/docs/insights/PrioritizeVisibleContent)
In short, it requires that part of the CSS is loaded into the header directly.
So in general the RenderRawContent suits me well, but not cached. So I tried the RenderCachedRawContent and it falls.

By all means thank you for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants