Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Add whitelist support to OPcache

Aberta
#23,335 2 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
45/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
c, php
Domínio
backend, performance

Direção de pesquisa

Comece examinando a configuração opcache.blacklist_filename existente do OPcache e o comportamento de inicialização do PHP-FPM descrito na proposta. Determine onde devem ficar a configuração de whitelist e a exclusividade entre blacklist/whitelist; considera-se concluído quando somente os arquivos incluídos na whitelist são armazenados em cache e o PHP-FPM falha na inicialização quando ambas as configurações estão definidas.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Extension: opcache Feature Status: Needs Triage
Description

OPcache currently supports excluding files using opcache.blacklist_filename. This works well when the number of files to exclude is small.

However, in a multi-tenant application, the opposite can be true. There may be a large number of tenant-specific files that should not be cached, while only a small set of common application files should be cached.

For example, instead of maintaining:

/var/www/tenant-a/*
/var/www/tenant-b/*
/var/www/tenant-c/*
...

it would be useful to define the files that are allowed to be cached:

opcache.whitelist_filename=/path/to/whitelist

with:

/var/www/app/src/*
/var/www/app/vendor/*

The behavior would simply be the inverse of the blacklist: when a whitelist is configured, only matching files are cached.

I think blacklist and whitelist should be mutually exclusive, with PHP-FPM failing at startup if both are configured.

This would be particularly useful for applications where the set of files that should be cached is small and well-defined, while the set of files to exclude is large or dynamic.

I'm happy to implement this and open a PR if this proposal makes sense.

Linguagem predominante
C
Estrelas
40.4k
Forks
8.2k
Merge médio
2d 17h
PRs com merge (30d)
115

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de php/php-src

Todas as issues de php/php-src

Issues semelhantes

Mais issues de C

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.