slight refactors

This commit is contained in:
Zoe
2022-12-14 23:36:34 -06:00
parent 216fd468ce
commit 53fe2087c6
11 changed files with 103 additions and 89 deletions

View File

@@ -22,7 +22,7 @@ tags:
- nodejs
- redis
---
So yesterday I talked about my social media site that I'm working on. Today I implemented redis, a memory store that I used to reduce requests at most by 48ms. First when I tried to use redis I just used the `redis` package off of npmjs because it only makes sense but when I tried to get a key with the name of `user-cache-[userId]` It failed for some reason, I still dont know why it failed but using the `ioredis` package and everything started working, not user data processing, what I used redis to cache since it's a terrible for loop that executes database requests for every post, but now it's all stored in memory.<!--more--> I still want to add TTL since my VPS that I intend on deploying my site on for production only has 1GB of RAM but I'm not sure how to do that. If you saw my blog post from [yesterday](/blog/what-ive-been-doing) then you'll know what my user code used to look like, now it looks like this.
So yesterday I talked about my social media site that I'm working on. Today I implemented redis, a memory store that I used to reduce requests at most by 48ms. First when I tried to use redis I just used the `redis` package off of npmjs because it only makes sense but when I tried to get a key with the name of `user-cache-[userId]` It failed for some reason, I still dont know why it failed but using the `ioredis` package and<!--more--> everything started working, not user data processing, what I used redis to cache since it's a terrible for loop that executes database requests for every post, but now it's all stored in memory. I still want to add TTL since my VPS that I intend on deploying my site on for production only has 1GB of RAM but I'm not sure how to do that. If you saw my blog post from [yesterday](/blog/what-ive-been-doing) then you'll know what my user code used to look like, now it looks like this.
```js[post.js]
for (let i = 0; i < replies.length; i++) {

View File

@@ -2,8 +2,8 @@
title: Rebuilding my personal website!
description: My experiences with nuxtjs 3 and tRPC
image:
src: '/images/website-rebuild-draft-1.avif'
alt: 'Why I chose archlinux'
src: 'https://via.placeholder.com/1920x1080.png?text=placeholder'
alt: 'placeholder'
head:
meta:
- name: 'keywords'
@@ -18,9 +18,8 @@ date: 2022-09-20
_draft: false
tags:
- web dev
- fullstack development
- nuxtjs 3
- supabase
---
Recently I've been working with nuxtjs 3 and tTRPC. I've heard a lot of things about nuxtjs 3 and tRPC lately, mostly bad with nuxtjs 3 and mostly good with trpc. These are not technoligies I've been interested in working with for a while
For the past month I've been quietly rebuilding my portfolio site, designing and building a new site. My previous site was bland and dull, this one is like a whole new world. The old site was just a two colors that don't even go well together, it was clear to me that was no way to present myself. So about halfway though november I started fresh, with Nuxt3 and a whole lot of insomnia in my possession I went to figma to design my new site. <!--more--> After a couple days of making a design in figma I setup a new nuxt3 project and