optimized dir links generation