Optimise Percona 5.7 my.cnf for a 32GB mixed nginx/php/mysql server
32GB RAM, 12G buffer_pool --> lots of room left over for resizing images.
12G buffer_pool, 0.5GB ibdata1 and 5.7 --> innodb_file_per_table is probably ON.  Is it?  If so, you have not given us a clue of how much data you have.  Look at the .ibd files.

query_cache_size = 256M is probably bad.  Any write to a table causes the purging of all QC entries for that table.  The purging is proportional to the size of the QC.  Keep it under 50M.  (Or turn it off.)

A Rule of Thumb:  "Don't put a cache in front of a cache."  MySQL does a lot of caching internally; adding a webapp-level cache may not help, and may rob RAM from the buffer_pool, where it is important.

Do you know if you are I/O-bound?  CPU-bound?

I see that you have the slowlog on.  Use pt-query-digest to summarize it.  Then, let's discuss the worst couple of queries.  Fixing slow queries is more likely to give your performance a boost than any tuning.

But, if you would like more tuning advice, let's see the GLOBAL STATUS.  In particular, follow the directions here .