littlest library on the side of the road

3 things I learned this week (caching and frying)

Caching Issue 1: For Vercel-deployed Vite apps (see my mobile-first offline-first screenwriting app, caching is super aggressive. This means that you can make changes and deploy to Vercel, but when you open the link to test it live, you may be using an old version.

On desktop, you have to go to chrome dev tools > application > storage > clear site memory.

On mobile, there's no granular way to delete application history (especially for PWA-style apps), so you need to clear all history/cookies/cache since your last site load. I tried deleting website data from Safari>Advanced, but this didn't work, despite what ChatGPT thought. It mentioned that iOS googe chrome uses Safari's caching APIs (or something in the vein), but I wasn't able to specifically target 1 domain to clear cookies for. Mobile PWAs like nikkowrite are great, but make sure you're happy with what you put out, because it's hard to make something offline-friendly and also easily test new changes when you make them.

Similarly, this was the reason I had issues when I pushed new code to Vercel (via a Github connection where new PRs automatically trigger Vercel webhooks to deploy the new changes to prod under my domain nikkowrite.vercel.app). The old version was cached with service workers, so I wasn't able to get the new version until I cleared site data. All these overlapping issues made it difficult to understand what my bugs were and how to fix them, since I wasn’t sure if the bugs were on the site level, the hosting level, the version level, or something else.

Caching Issue 2: For the python cli tool (to automatically aggregate different bank csv outputs into a format I want to use for doing my monthly budget) I built using uv - one of the greatest python projects I’ve ever used, I had a few bugs with the handling of negative values (ie not seeing refunds in my output).

I updated the cli tool to fix these bugs, but didn't get the changes in my "production" version installed globally to my zsh because of caching with uv.

This may have been a rookie mistake, but I forgot I needed to bump the project version number in pyproject.toml before running uv tool install --force . to get a new version installed on my system. Without bumping the project version number, I could run uv tool install —force . but running my budget-cli tool would default to the first installed version of the tool due to reliance on the project version.

A good way to check the version number is with uv tool list, and this should be good practice from now on.

Frying Issue 1: I love the crispy rice from Nobu copycat recipe here but have struggled in the past to get it right at home.

The gist is that you make sushi rice, then compact it into a thin block and refrigerate. When it has set overnight, you can take it out, slice it into domino-ish sized rectangles, and then fry until crispy. You then top it with spicy tuna or whatever toppings you want, and then serve.

Some issues popped up during this process:

  1. Not enough oil: you need at least enough oil to cover half the thickness of the rice domino. This is why I will always be a proponent of frying in a small sauce pot (2 quarts or less). This wastes less oil, and the taller sides help keep the splatter down.
  2. Leave it be: unless you want the rice domino to disintegrate, you need to let it sit for a few minutes. I made the mistake of trying to flip my rice dominos early to avoid sticking to the pot, which cause them to tear, break, and lose most of their rice. The initial waiting period is essential for the block to form and hold its shape, so plop in your rice, and do NOT touch it for 2 minutes.
  3. Don’t leave it for too long: I made the other mistake of overcompensating for problem 2. I wanted the rice to hold its shape so I could flip it and remove it from the oil properly, so I left it in the oil for ~3-4 minutes per side. This will vary greatly based on your oil volume, oil temp, and rice block size, but this was too much time for me to fry the rice dominos. By the end, I had gotten the shapes set and perfectly rectangular, but the blocks were far too crispy. What might sound good as an ASMR audio clip in a TikTok cooking video does not necessarily taste or feel good to eat, and the intense crunch I got from my rice blocks was not inline with my ideal mouth feel.