Diffusion in porous layers with memory