79767410

Date: 2025-09-17 13:43:29
Score: 0.5
Natty:
Report link

I believe the most practical way to do this is by using a temporary database (in-memory or cache), such as Redis or even SQLite (I recommend Redis).

You can install Redis on your server, for example using the official Docker image:
https://hub.docker.com/\_/redis

The flow would be:

  1. Generate a token when the user opens the page in the browser.

  2. Save the game data in Redis using this token as the key, using Put commands.

  3. Set a TTL (Time To Live) for the key, which determines the expiration time. For example, 86400 seconds (24h) or calculating until the end of the current day.

  4. After the TTL expires, the record and token are automatically deleted from Redis, ensuring that the daily game data is only temporarily available.

To implement this, you will need a small structured backend (your choice of framework), so Vue is only responsible for communicating with it without exposing your routes.

You can also use third-party APIs; a good example is Supabase. It’s simpler to set up, but depending on the scale of your game, it may be costly.

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Leonardo Porte