Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traduction de cached-components.md #29

Merged
merged 5 commits into from
Oct 31, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions en/faq/cached-components.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
---
title: Caching Components
description: How to cache components?
title: Composants avec cache

Choose a reason for hiding this comment

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

Composants avec cache => Mettre en cache les composants

description: Comment mettre en cache des composants ?
---

# How to cache Vue components?
# Comment mettre en cache des composants Vue ?

> Although Vue's SSR is quite fast, it can't match the performance of pure string-based templating due to the cost of creating component instances and Virtual DOM nodes. In cases where SSR performance is critical, wisely leveraging caching strategies can greatly improve response time and reduce server load.
> Bien que le rendu côté serveur de Vue soit rapide, il ne rivalise pas avec les performances d'un template basé sur une chaine de caractère pure, et ceux, à cause du coût de création des instances de composant et des nœuds du DOM virtuel. Dans le cas où les performances du rendu côté serveur est critique, mettre en place une bonne stratégie de mise en cache peut grandement améliorer le temps de réponse et réduire la charge serveur.
Copy link

Choose a reason for hiding this comment

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

"à cause du cout"


To avoid boilerplate, use [Component Cache module](https://github.com/nuxt-community/modules/tree/master/packages/component-cache) for Nuxt.js.
This module uses vue-server-renderer to add LRU cache support for Vue components.
Vous pouvez utiliser le module [Component Cache](https://github.com/nuxt-community/modules/tree/master/packages/component-cache) pour Nuxt.js.
Ce module utilise `vue-server-renderer` pour ajouter le support d'un cache [LRU](https://fr.wikipedia.org/wiki/Algorithmes_de_remplacement_des_lignes_de_cache#LRU_.28Least_Recently_Used.29) pour les composants Vue.

## Usage
## Utilisation

- Ajoutez la dépendance `@nuxtjs/component-cache` en utilisant Yarn ou npm pour votre projet.
- Ajoutez `@nuxtjs/component-cache` to `modules` section of `nuxt.config.js`.

Choose a reason for hiding this comment

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

Ajoutez @nuxtjs/component-cache to à la section modules section of de nuxt.config.js.


- Add `@nuxtjs/component-cache` dependency using yarn or npm to your project
- Add `@nuxtjs/component-cache` to `modules` section of `nuxt.config.js`
```js
{
modules: [
// Simple usage
// Utilisation simple
'@nuxtjs/component-cache',

// With options
// Avec des options
['@nuxtjs/component-cache', {
max: 10000,
maxAge: 1000 * 60 * 60
Expand All @@ -29,12 +30,11 @@ This module uses vue-server-renderer to add LRU cache support for Vue components
}
```

See [component-level caching](http://ssr.vuejs.org/en/caching.html#component-level-caching) for more information.

## Don't forget, that
Voir [la mise en cache au niveau composant](http://ssr.vuejs.org/en/caching.html#mise-en-cache-au-niveau-du-composant) pour plus d'informations.

- Cache-able component **must define a unique `name` option**.
- You should ***NOT*** cache components, that
- has child components that may rely on global state.
- has child components that produces side effects on the render `context`.
## N'oubliez pas

- Les composants à mettre en cache **doivent définir une option `name` unique**.
- Vous **NE** devez ***PAS*** mettre en cache un composant si
- ses composants enfants sont liés à ur état global ou si

Choose a reason for hiding this comment

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

ses composants enfants sont liés à ur état global ou si => ses composants enfants sont liés à l'état global

- ses composants enfants produisent des effets de bord sur le rendu de `context`.
2 changes: 1 addition & 1 deletion en/faq/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{ "name": "Comment étendre la configuration de webpack ?", "to": "/extend-webpack" },
{ "name": "Comment ajouter des plugins webpack ?", "to": "/webpack-plugins" },
{ "name": "Comment changer le HOST et le PORT ?", "to": "/host-port" },
{ "name": "Comment utiliser des composants avec cache ? (EN)", "to": "/cached-components" },
{ "name": "Comment mettre en cache des composants ?", "to": "/cached-components" },
{ "name": "Comment intégrer Google Analytics ?", "to": "/google-analytics" }
]
},
Expand Down