albert__
Hi.
First, this is not a Dédalo issue.
Dédalo's publication process involves writing the information into MariaDB/MySQL or any other database that supports classic/standard SQL (or other standards like RDF in Virtuoso for SPARQL, XML, or other data formats).
The OpenAPI implementation reads this information and serves as a helpful tool for searching and resolving relationships in a standardized manner. However, it doesn't implement advanced optimization strategies beyond typical SQL practices.
Therefore, slow responses are a problem with your specific database, and you should implement a SQL strategy to enhance the queries.
Things that you can do:
Review the RAM, HD, processor, etc.
Review the configuration of your DDBB to meet your needs.
I recommend to reproduce the equivalent SELECT that you are doing in the Dédalo API directly in the MariaDB/MySQL (it will be as slow as the API), and REINDEX, OPTIMIZE, and try to implement any typical SQL strategy to improve your calls.
Dédalo, by default, creates a classical INDEX by column for a typical publication (some are FULL-TEXT). In most typical situations, it works perfectly. However, if you have a specific requirement or want to improve a specific search combination, you can add or change the INDEXES, implement triggers, or use materialized views to enhance your searches.
For instance, I noticed that you're specifying a field "order": "fecha_publicacion desc". It might be beneficial to create a specific INDEX for this column and order.
Another option is to rethink your publication ontology to consolidate all the information in a single call, thereby avoiding the time-consuming resolve_portals_custom method. Additionally, you can add a property to the ontology that resolves the "{"identifying_image_data": "image"}" to gain access to this resource directly.
Etc.
In short: implement all classical improvements into your MariaDB/MySQL in the way that you need. It all depends on your needs...
Best