Eduardo Zepeda's latests posts

django and redis

Adding a section of visited products increases sales in an ecommerce and keeps the user longer on the page. It is normal to add this history to a user who is already in the database. The website managers have a history of the products we view, the ones we buy, how much time we spend viewing them and many other data but… what about the anonymous users who do not have a history? What about anonymous users who do not have an account?

","datePublished":"Sat, 28 Nov 2020 00:00:00 +0000","dateModified":"Sat, 28 Nov 2020 00:00:00 +0000","author":{"@type":"Person","name":"Eduardo Zepeda"},"mainEntityOfPage":{"@type":"WebPage","@id":"https://coffeebytes.dev/en/django/how-to-create-a-history-of-visited-products-with-django-and-redis/"}},{"@type":"BlogPosting","headline":"Django Annotate and aggregate explained","description":"

The computer screen illuminated my face full of despair, I rubbed my head in despair, while I googled: “Django annotate”; one of the ORM functions that I could not understand. Did it happen to you too, I bet it did. I had already read the documentation but it didn’t seem clear enough and, to top it off, I often confused it with its evil twin: aggregate. After visiting several stackoverflow questions and multiple English blogs I was able to understand them both. These notes are the result of that search, it is the explanation about django annotate and aggregate in Django that I would have liked to read years ago.

","datePublished":"Tue, 17 Nov 2020 00:00:00 +0000","dateModified":"Tue, 17 Nov 2020 00:00:00 +0000","author":{"@type":"Person","name":"Eduardo Zepeda"},"mainEntityOfPage":{"@type":"WebPage","@id":"https://coffeebytes.dev/en/django/django-annotate-and-aggregate-explained/"}},{"@type":"BlogPosting","headline":"Nginx keepalive, gzip, http2: better performance on your website","description":"

Some months ago I was reviewing the Lighthouse settings for a website when I realized that it did not comply with certain recommendations, it was using http/1.1, no gzip compression, no cache. Later I fixed the problems, I’ll tell you how below. In this post I talk about the following nginx features: keepalive, gzip, cache and http2 and how you can modify them to improve your Lighthouse values.

Activate http2 in nginx

As surprising as it may sound, many servers do not enable HTTP/2 by default, so if this is your case, you can enable it for better performance. The HTTP/2 protocol is more efficient than HTTP/1, so you get better indicators using it.

","datePublished":"Sat, 07 Nov 2020 00:00:00 +0000","dateModified":"Sat, 07 Nov 2020 00:00:00 +0000","author":{"@type":"Person","name":"Eduardo Zepeda"},"mainEntityOfPage":{"@type":"WebPage","@id":"https://coffeebytes.dev/en/linux/nginx-keepalive-gzip-http2-better-performance-on-your-website/"}},{"@type":"BlogPosting","headline":"Books I read","description":"

Currently reading

I’m currently reading:

  • The Rust Programming Language by Steve Klabnik

\"The
The rust programming language book

Books I read

The list below contains almost all the books I’ve read about programming and web development. Most of them are written in English, some others in Spanish (It’s arduous to find good technical books written in spanish). .

I’ve reviewed some of them, I hope to review most of them in the near future, before they become obsolete.

","datePublished":"Thu, 05 Nov 2020 00:00:00 +0000","dateModified":"Thu, 05 Nov 2020 00:00:00 +0000","author":{"@type":"Person","name":"Eduardo Zepeda"},"mainEntityOfPage":{"@type":"WebPage","@id":"https://coffeebytes.dev/en/pages/books-i-read-and-reviews/"}},{"@type":"BlogPosting","headline":"FastAPI tutorial, the best Python framework?","description":"

These last few days I have been testing a Python library that is becoming famous, FastAPI, a framework for creating APIs, such as REST APIs or RPC APIs. FastAPI promises to help us create fast APIs in a simple way, with very little code and with extraordinary performance, to support high concurrency websites.

FastAPI vs Django vs Flask vs Pyramid

Is FastAPI really that fast? Yes, at least that’s the evidence. FastAPI is in first place in responses per second compared to more popular Frameworks such as Django, Pyramid or Flask. And it is also in the first places if we compare it with Frameworks of other programming languages, such as PHP or Javascript.

","datePublished":"Tue, 27 Oct 2020 00:00:00 +0000","dateModified":"Tue, 27 Oct 2020 00:00:00 +0000","author":{"@type":"Person","name":"Eduardo Zepeda"},"mainEntityOfPage":{"@type":"WebPage","@id":"https://coffeebytes.dev/en/fastapi/fastapi-tutorial-the-best-python-framework/"}}]}