Skip to content

View routes caching empty payload (with redis) #987

@mshick

Description

@mshick

I've tried using redis caching for a route that renders a simple view. I have caching working generally with the basic request.reply({ 'greeting': 'hello world' }) style response.

When I attempt a similarly simple test with a rendered Handlebars view I get all normal caching behavior (set / get / expiry) but an empty payload, e.g.,

"set" "hapi-cache:%2F:%2F" "{\"item\":{\"code\":200,\"payload\":\"\",\"headers\":{},\"flags\":{}},\"stored\":1374187970387,\"ttl\":20000}"

I've tried all the documented forms for generating a view, with the same results.

Is this a bug, or am I missing something?

-- Here's my view rendering code --

    handler: function (request) {
        var context = {
            title: 'Homepage',
            page: {
                name: 'Stub',
                contents: 'Not yet.'
            }
        };

        request.reply.view('index', context);
    }

Metadata

Metadata

Assignees

Labels

bugBug or defect

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions