Search code examples
google-app-enginechannel-api

What counts as a 'channel open'?


On the billing page, I see that it costs $0.00001 to 'open' a channel. What does that mean, though? Is that the cost for creating a token, or for using it at a client to open a socket?

If it's the cost of opening a socket at the client, does that mean that creating tokens are free?

And how about if the user refreshes the page? Will that count as another opening, and be charged again?


Solution

  • The thing is, what's the point in creating a token and not using it on the client side?

    General solution to "user refreshes the page" is to store a newly created token somewhere like Memcache, Datastore or user's session, and use that instead of creating a new token every time the same user refreshes a page.

    Note that tokens are valid for 2 hours max, so you'll need to create another token every 2 hours (assuming your user is refreshing a page 24 hours / day).