CodexWorker

Backend Vývojář | Go, Mikroslužby, Škálovatelnost

Today's App Updates: Performance, SEO & Internationalization Improvements

What developments have taken place today?

This collection of commits addresses several key areas of the application, focusing on performance optimization, database schema improvements, URL management, internationalization, and search functionality.

The first set of changes significantly improves the retrieval of discounted product data from Elasticsearch. A caching mechanism is implemented to reduce load on the database and accelerate subsequent requests for frequently accessed categories. The underlying query logic has been updated to utilize internal category IDs instead of Google Category IDs, streamlining queries and enhancing performance. Logging improvements provide clearer insights into the process.

A second set of changes centers around standardizing slug generation for products and stages. This includes a new database column (slug) in the products_stage table, alongside a generateSlug function that handles diacritics removal and hyphenation for consistent URL formatting. These updates are reflected across various templates and code locations, ensuring proper slug usage throughout the application.

Further improvements were made to URL structure and routing. The application’s CDN image server and API endpoints have been updated with new port numbers; RabbitMQ endpoint URLs have also been adjusted. Additionally, a new outbound product link route (/product-exit/:id) has been introduced.

Internationalization efforts have been expanded through the introduction of LoadTranslations function for loading translation files from JSON format, alongside modifications to the Registry struct and template functions to support multiple languages dynamically. The use of the T function allows templates to display localized content using a consistent approach, providing fallback mechanisms for missing translations.

Finally, search functionality has been enhanced by incorporating translations utilizing a new T function to replace hardcoded strings with translated versions across various UI elements including product details, results pages, and pagination. URL generation for category links now incorporates slugs alongside database IDs, while the Elasticsearch indexing includes a slug field as a keyword type.

Overall, these changes represent a series of important improvements that enhance performance, maintainability, user experience (particularly regarding internationalization), and overall system stability.

performance optimization database schema url management internationalization search functionality