Skip to content

Conversation

araslanov-e
Copy link

@araslanov-e araslanov-e commented Mar 20, 2025

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Documentation Update

Description

Используя NewRelic обнаружил проблему на главной странице, и оптимизировал загрузку

Added to documentation?

  • docs.dev.to
  • readme
  • no documentation needed

Copy link
Collaborator

@spajic spajic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Очень много времени загружаются шаблоны `_single_story.html.erb`

### Решение
Данные шаблоны содержат минимальную информацию, которая редко меняется, за исключением количества лайков и комментариев. Было решено закэшировать каждый шаблон по отдельности, чтобы при обновлении story сбрасывался кэш для соответствующего шаблона. Внутри шаблона `positive_reactions_count` и `comments_count` это поля статьи, при обновлении меняется `updated_at` и сбрасываетс кэш.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

лайк за пояснение про сбрасывание кэша reactions и comments

@@ -5,9 +5,9 @@
- в .env вставить свои ключи от Algolia
- gem install dip (maybe change .ruby-version file with your ruby ver)
- cd .dev_to
- docker-compose build
- dip compose build
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants